用对象收编变量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; }
}
标签:script this post log return pos 基础 obj 设计模式
用对象收编变量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; }
}
标签:script this post log return pos 基础 obj 设计模式
原文地址:http://www.cnblogs.com/rudylemon/p/8039216.html