Skip to content

Instantly share code, notes, and snippets.

@froots
Created December 1, 2010 07:22
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 froots/723104 to your computer and use it in GitHub Desktop.
Save froots/723104 to your computer and use it in GitHub Desktop.
Example gist for testing import into web page
var myModule = (function(w) {
var internal = "I'm hidden",
privateMethod = function() {
return "Message is " + internal;
},
publicMethod = function() {
return privateMethod().replace('hidden', 'visible');
};
return {
publicMethod: publicMethod
};
})(window);
myModule.publicMethod();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment