Skip to content

Instantly share code, notes, and snippets.

@fhsinchy
Created May 27, 2020 14:45
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 fhsinchy/9a6753308a6c688a30ed12f9949b152c to your computer and use it in GitHub Desktop.
Save fhsinchy/9a6753308a6c688a30ed12f9949b152c to your computer and use it in GitHub Desktop.
let globalThis = this;
function func1() {
console.log('Global This: ', globalThis);
console.log('Local This: ', this);
console.log('Are they same?', globalThis === this);
}
func1()
// Global This: Window
// Local This: Window
// Are they same? true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment