function car(brand,money){
this.brand = brand;
this.money = money;
this.info = function(){
return this.brand + '要卖' + this.money;
}
}为什么说info每次new的时候需要重新定义,而放在car.prototype.info的时候就可以在实例之间共享
请给我详细解释下,我大概知道一些
西兰花伟大炮
两年3900165
随时随地看视频慕课网APP
相关分类