Skip to content

Instantly share code, notes, and snippets.

@isaacs
Created January 19, 2010 20:12
Show Gist options
  • Save isaacs/281248 to your computer and use it in GitHub Desktop.
Save isaacs/281248 to your computer and use it in GitHub Desktop.
(function () {
// exports will be set in any commonjs platform.
// because the anonymous function is being called without
// a scope being set, "this" will refer to the global scope.
// In a browser, that's the window. In other JS platforms,
// it may be some other thing.
var out = typeof exports !== "undefined" ? exports : this;
// my code here.
// don't make accidental globals.
// hang a small number of things on the "out" object.
out.MyThing = "squarrrrrkkk!!!";
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment