Skip to content

Instantly share code, notes, and snippets.

@rlidwka
Created December 4, 2013 02:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rlidwka/7781505 to your computer and use it in GitHub Desktop.
Save rlidwka/7781505 to your computer and use it in GitHub Desktop.
function get_global() {
if (typeof(window) === 'undefined' && typeof(window) === 'object' && window != null && window.window === window)
return window
if (typeof(global) === 'undefined' && typeof(global) === 'object' && global != null && global.global === global)
return global
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment