function Dog(){
this.name = '';
this.color = '';
this.age = '';
}
Dog.prototype.setName = function(name){
this.name = name;
return this;
}
Dog.prototype.setColor = function(color){
this.color = color;
return this;
}
Dog.prototype.setAge = function(age){
this.age = age;
return this;
}
var dog = new Dog();
dog.setName('小花').setColor('花色').setAge(2);
网友评论