悄悄拔尖

原型链问题

function Foo1(){
   this.name1 = '1';
}
function Foo2(){
   this.name2 = '2';
}
Foo2.prototype = new Foo1();
function Foo3(){
   this.name = '3';
}
Foo3.prototype = new Foo2();
var foo3 = new Foo3();
console.dir(foo3);

  最后结果:

 

posted @ 2020-10-27 14:49  听见海棠花未眠  阅读(77)  评论(0)    收藏  举报