// 字面量写法
var obj={};
obj.a=function(){
console.log("a");
return this;
};
obj.b=function(){
console.log("b");
return this;
};
obj.a().b();
// 原形链写法
var JQ = function(){};
JQ.prototype = {
show:function(){
console.log("show");
return this;
},
hide:function(){
console.log("hide");
return this;
}
};
var jq = new JQ();
jq.show().hide();