Vidyalelo
JavaScript · Q8

Classes And Modules

Programming · JavaScript · question 8

Q8

If A is the superclass and B is the subclass, then subclass inherting the superclass can be represented as

A.
B=inherit(A);
B.
B=A.inherit();
C.
B.prototype=inherit(A);
Answer
D.
B.prototype=inherit(A.prototype);

Answer: Option C

Solution

Answer: Option C
Solution:
The subclass B inherits the prototype of the class A.