Created
November 4, 2016 18:10
-
-
Save tkraak/ec969bdde4271c2ace44414d1196627d to your computer and use it in GitHub Desktop.
Gist from mistakes.io
This file contains hidden or 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
// standalone function invocation: default binding | |
function foo() { | |
return this.a; | |
} | |
var a = 42; | |
foo(); | |
var obj = { | |
a: 2, | |
foo: foo | |
} | |
obj.foo(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment