Is it just me, or is Function.call like a “Licker” from Resident Evil 2 and Function.apply like the final beast?
Seriously, Function.call is neat and all, but even though they advertise “…code that is concise and readable…” in the docs, to me, apply offers more concise code than call does. The only time I could think where I’d prefer to use call insead of apply is if I was creating arguments inside a function and didn’t have access to my arguments object to put them in.
var arg1 = “moo”;
var arg2 = “wuzzup”;
this.otherFunction.call(_level2, arg1, arg2);
To me, there is no way to easily type in your arguments, unless you did:
this.otherFunction.apply(_level2, [arg1, arg2]);
Which certainly isn’t as readable. I still think <code>call</code> got shafted, though.