function People(){
this.name = 'people';
}
function Man(){
this.name = 'man';
}
Man.prototype = new People();
为原型赋值的是父类的实例,而不是引用
JS原型继承详解
function People(){
this.name = 'people';
}
function Man(){
this.name = 'man';
}
Man.prototype = new People();
643

被折叠的 条评论
为什么被折叠?