Skip to content

Instantly share code, notes, and snippets.

@devdays
Created December 7, 2014 18:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devdays/a6e740664ea6b2fdbd6f to your computer and use it in GitHub Desktop.
Save devdays/a6e740664ea6b2fdbd6f to your computer and use it in GitHub Desktop.
var Module = (function() {
// Following function is private, but can be accessed by the public functions
function privateFunc() { ... };
// Return an object that is assigned to Module
return {
publicFunc: function() {
privateFunc(); // publicFunc has direct access to privateFunc
}
};
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment