function AAA() { this.name = "AAA name"; } function BBB() { } BBB.prototype = new AAA(); var bbb = new BBB(); var ccc = new BBB(); console.log(bbb.name); \\AAA name console.log(ccc.name); \\AAA name bbb.name = "111"; console.log(bbb.name); \\111 console.log(ccc.name); \\AAA name这不是原型链继承吗?为什么修改了bbb.name后,ccc.name不一起改变呢?
添加回答
举报
0/150
提交
取消