Skip to content

Instantly share code, notes, and snippets.

@jeremyckahn
Last active August 29, 2015 13:57
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeremyckahn/9621315 to your computer and use it in GitHub Desktop.
Save jeremyckahn/9621315 to your computer and use it in GitHub Desktop.
Access the global JavaScript object from any context, even in strict mode.
(function () {
// Strict mode is not necessary here, it's just used to demonstrate that this works.
'use strict';
return (new Function ('return this'))();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment