paste the code first
function ClassA(name) {
this.name = name
}
ClassA.prototype.sayName = function () {
//
}
function ClassB(name, age) {
ClassA.call(this, name)
this.age = age
}
//
ClassB.prototype.__proto__ = ClassA.prototype
ClassB.prototype.sayAge = function () {
//
}
let instance = new ClassB("", 11)
Why can"t ClassB.prototype.__proto__ = ClassA.prototype
be used in implementation inheritance?