Skip to content

Instantly share code, notes, and snippets.

@daihuaye
Created October 17, 2014 15:54
Show Gist options
  • Save daihuaye/35c64f7f41011d64ee43 to your computer and use it in GitHub Desktop.
Save daihuaye/35c64f7f41011d64ee43 to your computer and use it in GitHub Desktop.
JS best practice - module
module = function(){
var current = null;
var labels = {
'home':'home',
'articles':'articles',
'contact':'contact'
};
var init = function(){
};
var show = function(){
current = 1;
};
var hide = function(){
show();
}
return{init:init, show:show, current:current}
}();
module.init();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment