Skip to content

Instantly share code, notes, and snippets.

@ten1seven
Created April 25, 2012 14:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ten1seven/2490271 to your computer and use it in GitHub Desktop.
Save ten1seven/2490271 to your computer and use it in GitHub Desktop.
JavaScript Namespace
var JS = JS || {};
JS.Global = (function(window,document,undefined) {
'use strict';
var private_var;
function private_method() {
// do stuff here
};
var Self = {
'method_1': function() {
// do stuff here
},
'method_2': function() {
// do stuff here
}
};
return Self;
})(this,this.document);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment