Created
June 18, 2015 10:50
-
-
Save gladiatorAsh/a4bbf3b93e7463e4f371 to your computer and use it in GitHub Desktop.
Module Pattern
This file contains 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 | |
_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