js的继承有多种实现,但是最常用的是这种:
function parent() {}
function child() {}
child.prototype = Object.create(parent.prototype)
child.prototype.constructor = child
js的继承有多种实现,但是最常用的是这种:
function parent() {}
function child() {}
child.prototype = Object.create(parent.prototype)
child.prototype.constructor = child
转载于:https://my.oschina.net/sheaned/blog/743892