function Obj(){};
Obj.prototype ={
setName: function(name){
this.name = name;
return this; //返回this是实现链式操作的重点
},
setVersion: function(version){
this.version= version;
return this;
}
}
var obj= new Obj();
obj.setName("Mary").setVersion('1.0.0');