Skip to content

Instantly share code, notes, and snippets.

@jinlong
Created September 4, 2013 07:58
Show Gist options
  • Save jinlong/6433987 to your computer and use it in GitHub Desktop.
Save jinlong/6433987 to your computer and use it in GitHub Desktop.
module pattern 模块模式。
var Module = (function(){
var privateProperty = 'foo';
function privateMethod(args){
//do something
}
return {
publicProperty: "",
publicMethod: function(args){
//do something
},
privilegedMethod: function(args){
privateMethod(args);
}
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment