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
相关文章
相关标签/搜索