Skip to content

Instantly share code, notes, and snippets.

@jackz3
Created May 9, 2012 15:05
Show Gist options
  • Save jackz3/2645236 to your computer and use it in GitHub Desktop.
Save jackz3/2645236 to your computer and use it in GitHub Desktop.
var Module = (function() {
// 现在所有函数直接互访
var privateFunc = function() {
publicFunc1();
};
var publicFunc1 = function() {
publicFunc2();
};
var publicFunc2 = function() {
privateFunc();
};
// 返回对象赋予Module
return {
publicFunc1: publicFunc1,
publicFunc2: publicFunc2
};
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment