Question discussion

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

319812Medium 1 reply 539 views
0
If A is the superclass and B is the subclass, then subclass inherting the superclass can be represented as
  • AB=inherit(A);
  • BB=A.inherit();
  • CB.prototype=inherit(A);
  • DB.prototype=inherit(A.prototype);
Correct answer: C

Discussion 1

0
CCommunity
B.prototype=inherit(A);

The subclass B inherits the prototype of the class A.