Created
December 14, 2013 15:14
-
-
Save rauschma/7960405 to your computer and use it in GitHub Desktop.
Cross-platform way of referring to the global object.
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 (glob) { | |
| // glob points to global object | |
| }(typeof window !== 'undefined' ? window : global)); |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Absolutely! Language shims may be another use case, but also a rare one.