slice a javascript funtion arguments

[1,2,3].slice(1)//[2, 3]

function t(){
//arguments.slice(1);//won't work. Can not directly slice the arguments. You can think it is not an array
var b=[].slice.call(arguments,1);
console.log(b);
}

t(1,2,3);

你可能感兴趣的:(JavaScript)