|
@@ -27,10 +27,11 @@
|
|
|
Person.call(this,val)
|
|
Person.call(this,val)
|
|
|
}
|
|
}
|
|
|
Child.prototype = new Person();
|
|
Child.prototype = new Person();
|
|
|
-
|
|
|
|
|
|
|
+ Child.prototype.constructor = Child;
|
|
|
let c1 = new Child('北京');
|
|
let c1 = new Child('北京');
|
|
|
let c2 = new Child('哈尔滨');
|
|
let c2 = new Child('哈尔滨');
|
|
|
c2.list.push("12");
|
|
c2.list.push("12");
|
|
|
|
|
+ console.log(c1.constructor,'打印');
|
|
|
console.log(c1, 'c1', c1.list)
|
|
console.log(c1, 'c1', c1.list)
|
|
|
console.log(c2, 'c2', c2.list)
|
|
console.log(c2, 'c2', c2.list)
|
|
|
c1.say()
|
|
c1.say()
|