What is the difference between using call and apply to invoke a function?
call
apply
var func = function() { alert(\'hello!\'); }; >
var func = function() { alert(\'hello!\'); };
Call() takes comma-separated arguments, ex:
.call(scope, arg1, arg2, arg3)
and apply() takes an array of arguments, ex:
.apply(scope, [arg1, arg2, arg3])
here are few more usage examples: http://blog.i-evaluation.com/2012/08/15/javascript-call-and-apply/