prototype不能用于实例,可以用于对象的建立
如:
function Car(){
this.color = "blue";
Car.prototype.show = function(){
}
}
而不能用
function Car(){
this.color = "blue";
this.prototype.show = function(){
}
}
prototype不能用于实例,可以用于对象的建立
如:
function Car(){
this.color = "blue";
Car.prototype.show = function(){
}
}
而不能用
function Car(){
this.color = "blue";
this.prototype.show = function(){
}
}