Created
March 18, 2011 12:53
-
-
Save kinsteronline/876018 to your computer and use it in GitHub Desktop.
Using this and exports in Underscore
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
var root = this; | |
// Export the Underscore object for **CommonJS**, with backwards-compatibility | |
// for the old `require()` API. If we're not in CommonJS, add `_` to the | |
// global object. | |
if (typeof module !== 'undefined' && module.exports) { | |
module.exports = _; | |
_._ = _; | |
} else { | |
root._ = _; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment