Which is better way to delegate the parent object to child object in prototypal inheritance in javascript?

后端 未结 0 366
暗喜
暗喜 2021-02-04 05:23
function Foo(firstName){
    this.firstName = firstName;
}

Foo.prototype.myName = function(){
   return this.firstName;
}

function Bar(firstName, lastName){
    Foo.ca         


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