function a(){
a.prototype.c="cc"
}
var aa=new a
alert(aa.c)//弹出cc
function b(){}
b.prototype.c="ccccc"
var bb=new b
alert(bb.c)//弹出ccccc
function c(){}
c.prototype=new a
alert(c.c)//弹出undefined
c=new b
alert(c.c)//弹出ccccc不好意思 刚才写错了
原型链 写在里面的 就不行了
a.prototype.c="cc"
}
var aa=new a
alert(aa.c)//弹出cc
function b(){}
b.prototype.c="ccccc"
var bb=new b
alert(bb.c)//弹出ccccc
function c(){}
c.prototype=new a
alert(c.c)//弹出undefined
c=new b
alert(c.c)//弹出ccccc不好意思 刚才写错了
原型链 写在里面的 就不行了
function a(){
a.prototype.c="cc"
}
var aa=new a
alert(aa.c)//弹出cc
function b(){}
b.prototype.c="ccccc"
var bb=new b
alert(bb.c)//弹出ccccc
function c(){}
c.prototype=new a
var cc=new c
alert(cc.c)//弹出cc
function d(){}
d.prototype=new b
var dd=new d
alert(dd.c)//弹出ccccc