Skip to content

Instantly share code, notes, and snippets.

@davidpadbury
Created May 11, 2011 15:23
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 davidpadbury/966663 to your computer and use it in GitHub Desktop.
Save davidpadbury/966663 to your computer and use it in GitHub Desktop.
Demonstration of the JavaScript module "pattern"
(function(global) {
function something() {
alert('something from lib1');
}
global.something = something;
})(window.lib1 = {});
(function(global) {
function something() {
alert('something from lib2');
}
global.something = something;
})(window.lib2 = {});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment