Skip to content

Instantly share code, notes, and snippets.

@rauschma
Created December 14, 2013 15:14
Show Gist options
  • Select an option

  • Save rauschma/7960405 to your computer and use it in GitHub Desktop.

Select an option

Save rauschma/7960405 to your computer and use it in GitHub Desktop.
Cross-platform way of referring to the global object.
(function (glob) {
// glob points to global object
}(typeof window !== 'undefined' ? window : global));
@rauschma
Copy link
Copy Markdown
Author

Absolutely! Language shims may be another use case, but also a rare one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment