Guest User

Untitled

a guest
Mar 17th, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. var indirect = { name: 'indirect function invocation' };
  2. function concatName(string) {
  3. console.log(this === indirect); // => true
  4. return string + this.name;
  5. }
  6. // Indirect invocations
  7. concatName.call(indirect, 'Hello '); // >> 'Hello indirect function invocation'
  8. concatName.apply(indirect, ['Bye ']); // >> 'Bye indirect function invocation'
Add Comment
Please, Sign In to add comment