Created
March 8, 2018 15:53
-
-
Save JunPyoL22/06ec13f8e78f073a3712d23ec6344010 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
var indirect = { name: 'indirect function invocation' }; | |
function concatName(string) { | |
console.log(this === indirect); // => true | |
return string + this.name; | |
} | |
// Indirect invocations | |
concatName.call(indirect, 'Hello '); // >> 'Hello indirect function invocation' | |
concatName.apply(indirect, ['Bye ']); // >> 'Bye indirect function invocation' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment