Skip to content

Instantly share code, notes, and snippets.



Last active Aug 29, 2015
What would you like to do?
`this` keyword in Javascript
function doThing() {
a = {name: "Joe", doThing: doThing};
b = {name: "Bill", doThing: doThing};
a.doThing(); // Name: Joe
b.doThing(); // Name: Bill
doThing(); // Name: undefined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment