-
-
Save kriskowal/281374 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function (exports) { | |
// 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, but | |
// will be "undefined" in strict mode. In other JS platforms, it may be some | |
// other thing. | |
// my code here. | |
// don't make accidental globals. | |
// hang a small number of things on the "exports" object. | |
exports.MyThing = "squarrrrrkkk!!!"; | |
})( | |
// exports will be set in any commonjs platform; use it if it's available | |
typeof exports !== "undefined" ? | |
exports : | |
// otherwise construct a name space. outside the anonymous function, | |
// "this" will always be "window" in a browser, even in strict mode. | |
this.NAMESPACE = {} | |
); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment