Just found the following example on the Mozilla web site:
Code:
var unboundSlice = Array.prototype.slice;
var slice = Function.prototype.call.bind(unboundSlice);
function list() {
return slice(arguments);
}
var list1 = list(1, 2, 3); // [1, 2, 3]
So a more generic version of that could be:
Code:
var A = Function.prototype.call.bind(Array.prototype.slice); // only needed once
function x() {
args = A(arguments);
//code to use args as an array
}