Call parent class' constructor function via call()

后端 未结 0 545
陌清茗
陌清茗 2021-01-14 12:31
// Parent class
function Person(name) {
  this.name = name;
}

Person.prototype.sayHello = function() {
  console.log("Hello. My name is " + this.name);
};         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题