javascript 原型模式实现类和对象
2017-08-29 本文已影响0人
Miya_hope
function Monster () {
this.tool = 'fork';
this.skin = 'blue';
}
var dog = new Monster();
dog.skin = 'speckle';
dog.name = 'rain';
console.log(dog);

function Monster () {
this.tool = 'fork';
this.skin = 'blue';
}
var dog = new Monster();
dog.skin = 'speckle';
dog.name = 'rain';
console.log(dog);