Skip to content

Instantly share code, notes, and snippets.

@kwyn
Created April 3, 2014 18:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kwyn/9959818 to your computer and use it in GitHub Desktop.
Save kwyn/9959818 to your computer and use it in GitHub Desktop.
var applyResult = 0;
var callResult = 0;
var sum = function(a, b, c){
return a + b + c;
};
applyResult = sum.apply(null, [1,2,3]); // returns 6
callResult = sum.call(null, 1, 2, 3); //also returns 6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment