All you know that arguments
is a special object that holds all the arguments passed to the function.
And as long as it is not an array - you cannot use something like arguments.slice(1)
.
So the question - how to slice everything but first element from arguments
?
UPD:
seems like there is no way without converting it to an array with
var args = Array.prototype.slice.call(arguments);
If someone posts another solution it would be great, if not - I'll check the first one with the line above as an answer.