function Fn(name,age){
this.name;
this.age;
}
Fn.prototype={
eat:function(){
this.name
}
}
console.log(Fn === Fn.prototype.constructor);
你的这句重新声明了一个对象给Fn.prototype那当然就不一样了
Fn.prototype={
eat:function(){
this.name
}
}
改成这样试一试
Fn.prototype.eat = function(){
this.name
}