Skip to content

Instantly share code, notes, and snippets.

@kristyburge
Created July 30, 2018 18:05
Show Gist options
  • Save kristyburge/e5459f0154bd796e8221edb3b7c7078a to your computer and use it in GitHub Desktop.
Save kristyburge/e5459f0154bd796e8221edb3b7c7078a to your computer and use it in GitHub Desktop.
When 'this' is used in a normal function context
function test() {
console.log('hello world');
console.log(this);
}
test();
// hello world
// Window {postMessage: ƒ, blur: ƒ, focus: ƒ, close: ƒ, frames: Window, …}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment