JavaScript 如何實現繼承?

  1.原型鏈繼承 function Parent () {this.name = 'aa';} Parent.prototype.getName = function () {     console.log(this.name); } function Child () {} Child.prototype = new Parent(); var child = new Child
相關文章
相關標籤/搜索