class A{
constructor(){
this.name="A";
}
M1(){
return "M1";
}
}
class B extends A{
constructor(){
this.id="B";
}
M2(){
return "M2";
}
}
var b = new B();
ReferenceError: this is not defined at B (repl:4:1) at repl:1:9 at REPLServer.defaultEval (repl.js:262:27) at bound (domain.js:287:14) at REPLServer.runBound [as eval] (domain.js:300:12) at REPLServer. (repl.js:431:12) at emitOne (events.js:82:20) at REPLServer.emit (events.js:169:7) at REPLServer.Interface._onLine (readline.js:211:10) at REPLServer.Interface._line (readline.js:550:8)
嗨Suren,你能不能请解释一下。 – user3666112
@ user3666112已更新 –
谢谢@Suren的帮助。 – user3666112