...

/

Quiz on Using Inheritance

Quiz on Using Inheritance

Test your knowledge of inheritance by taking this quiz.

We'll cover the following...
Technical Quiz
1.

The add() method of Set returns the instance of Set with the added element. Let’s change

const set = new FunctionalSet(['Jack', 'Jill', 'Tom', 'Jerry']);

to:

const set = new FunctionalSet(['Jack', 'Jill', 'Tom', 'Jerry']) .add('Bill');

What change do we have to make in the FunctionalSet class to make the add() function work for this modified code?

class FunctionalSet extends Set {
}
A.

By defining the add() method in FunctionalSet

B.

No change

C.

Making a derived class of FunctionalSet and defining the add() method in it.


1 / 5