Created
May 4, 2014 06:04
-
-
Save adohe-zz/997f5d4cfdee6c1ce521 to your computer and use it in GitHub Desktop.
Access to the global object in JavaScript
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
| // This should works in ES3, ES5 and ES5-strict | |
| var global = (function () { | |
| return this || (1, eval)('this'); | |
| }()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment