It is common place to see code like that around the web and in frameworks:
var args = Array.prototype.slice.call(arguments);
In doing so, you
Here's some q&d testing. Using predefined arguments
seems to be the fastest, but it's not always feasible to do this. If the arity of the function is unknown beforehand (so, if a function can or must receive a variable amount of arguments), I think calling Array.prototype.slice
once would be the most efficient way, because in that case the performance loss of using the arguments
object is the most minimal.