Skip to content

Instantly share code, notes, and snippets.

@danpark487
Created April 6, 2017 07:09
Show Gist options
  • Save danpark487/a3fa54886bbf3ad59eff1e0bf0666131 to your computer and use it in GitHub Desktop.
Save danpark487/a3fa54886bbf3ad59eff1e0bf0666131 to your computer and use it in GitHub Desktop.
let foo = {
bar: function () {
console.log(this);
};
};
foo.bar() // 'this' is bound to the 'foo' object because 'bar' was called with reference to 'foo'
let baz = foo.bar;
baz() // 'this' is bound to the Global Window Object because no reference was given when called
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment