Last active
September 12, 2018 11:14
-
-
Save manekinekko/f35bf0658a3b56ee7b837a0c115ee4e4 to your computer and use it in GitHub Desktop.
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
function foo() { | |
return this; | |
} | |
// invocation en tant que fonction | |
foo(); //=> this === window | |
var bar = { | |
'foo': foo | |
}; | |
// invocation en tant que méthode de 'bar' | |
bar.foo(); //=> this === bar |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment