用对象收编变量2种方式
1 函数式
var Object = {
name:function(){ return this; },
email:function(){ return this; }
}
Object.name().email();
2 类式
var Object = function(){};
Object.prototype = {
name:function(){ return this; },
email:function(){ return this; }
}
用对象收编变量2种方式
1 函数式
var Object = {
name:function(){ return this; },
email:function(){ return this; }
}
Object.name().email();
2 类式
var Object = function(){};
Object.prototype = {
name:function(){ return this; },
email:function(){ return this; }
}
原文:http://www.cnblogs.com/rudylemon/p/8039216.html