Skip to content

Instantly share code, notes, and snippets.

@bakkot
Last active November 29, 2018 20:55
Show Gist options
  • Save bakkot/a4a89fde725726c5b8f1a8ca285bbd4d to your computer and use it in GitHub Desktop.
Save bakkot/a4a89fde725726c5b8f1a8ca285bbd4d to your computer and use it in GitHub Desktop.

globalThis

  • PRO: almost shipping in Chrome, maybe used elsewhere
  • PRO: is actually correct
  • CON: might confuse JS beginners

Global

  • PRO: maybe less likely to confuse beginners
  • PRO/CON: looks like a namespace
  • CON: requires even more churn on this proposal

globalObject

  • PRO: maybe less likely to confuse beginners
  • CON: is not actually correct (depending on perspective)
  • CON: conflation with WindowProxy
  • CON: at least Domenic strongly objected for the above reason

global, self, top, frames, window, etc

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