Skip to content

Instantly share code, notes, and snippets.

@gladiatorAsh
Created June 18, 2015 10:50
Show Gist options
  • Save gladiatorAsh/a4bbf3b93e7463e4f371 to your computer and use it in GitHub Desktop.
Save gladiatorAsh/a4bbf3b93e7463e4f371 to your computer and use it in GitHub Desktop.
Module Pattern
var module = (function () {
var
_privateVar = 0,
_privateArray=[],
_privateString="",
_privateObj={},
_privateBool=false;
function _privateFunc () {
// body...
}
return {
publicMethod : function(){
_privateVar++;
_privateFunc();
},
init: function () {
this.publicMethod();
}
}
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment