function?car(brand,money){
????this.brand?=?brand;
????this.money?=?money;
????this.info?=?function(){
????????return?this.brand?+?'要賣'?+?this.money;
????????}
?????}為什么說info每次new的時候需要重新定義,而放在car.prototype.info的時候就可以在實例之間共享請給我詳細解釋下,我大概知道一些
js的prototype
西蘭花偉大炮
2017-03-08 19:12:00