两种对象构造器方式:
1:
function yongzi(name,maintype)
{
this.name=name;
this.maintype=maintype;
}
2:
yongzi.prototype.move=fucntion
{
return this.name+"的"+this.move;
}
使用方式:
var butterfly=new yongzi("butterfly","MichaelTypes");
alert(butterfly.move() );