A继承B和C,但是B和C没有改变
function C(c) {
this.c = c
}
C.prototype= {
fnc() {console.log(this.c)}
}
function B(b) {
this.b = b
}
B.prototype= {
fnb() {console.log(this.b)}
}
function A(a, b, c) {
B.call(this, b)
C.call(this, c)
this.a = a
}
A.prototype = {
fna(){console.log(this.a)}
}
Object.assign(A.prototype, B.prototype, C.prototype)
const a = new A(1, 2, 3)
console.log(a)
const b = new B(2)
console.log(b)
const c = new C(3)
console.log(c)
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。