1 /**
2 父亲
3 */
4 function Father(){
5 this.name = 'pine';
6 this.age = 27;
7 }
8
9 Father.prototype= {
10 birth:'1991-05-07',
11 address:'杭州市西湖区'
12 };
13 Father.prototype.constructor =Father;
14
15
16
17 /**
18 孩子
19 */
20 function Son(){
21 Father.call(this);
22 }
23
24 var son = new Son();
25 son
26 son.name
27 son.age
28 son.birth
29 son.address
30
31 son instanceof Father
32 son instanceof Son
33
34 Father.prototype.constructor==Father
35 Son.prototype.constructor==Son
36 /*
37 构造继承:
38 只能继承父类this中的属性,不能继承父类原型中的属性
39 子类实例对象不是 父类 的实例,只是 子类 的实例
40 */