Created
September 4, 2013 07:58
-
-
Save jinlong/6433987 to your computer and use it in GitHub Desktop.
module pattern 模块模式。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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