Posted on 1/10/09 by Felix Geisendörfer
var args = Array.prototype.slice.call(arguments);
This creates a variable called args that holds a true array version of the arguments variable. This works by hjacking the Array.splice function to make it work on the arguments variable.
Yes, this is the kind of code you might want to document for the poor kids who will have to debug grandpa's "AJAX museum" one day.
Got a better solution? Let me know!
-- Felix Geisendörfer aka the_undefined
You can skip to the end and add a comment.
This post is too old. We do not allow comments here anymore in order to fight spam. If you have real feedback or questions for the post, please contact us.