Skip to content

Instantly share code, notes, and snippets.

@eliperelman
Created July 6, 2011 04:08
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 eliperelman/1066545 to your computer and use it in GitHub Desktop.
Save eliperelman/1066545 to your computer and use it in GitHub Desktop.
Module/Namespacing/Singleton pattern
var Namespace = {};
Namespace.module1 = {
method1: function() {
// code here
}
};
Namespace.module2 = {
method2: function() {
Namespace.module1.method1();
}
};
Namespace.module2.method2();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment