-
-
Save danpark487/a3fa54886bbf3ad59eff1e0bf0666131 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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