function Monster () {
this.tool = 'fork';
this.skin = 'blue';
}
var dog = new Monster();
dog.skin = 'speckle';
dog.name = 'rain';
console.log(dog);
image.png
function Monster () {
this.tool = 'fork';
this.skin = 'blue';
}
var dog = new Monster();
dog.skin = 'speckle';
dog.name = 'rain';
console.log(dog);
image.png
本文标题:javascript 原型模式实现类和对象
本文链接:https://www.haomeiwen.com/subject/lofodxtx.html
网友评论