function a(){ console.log(arguments.length); var c = [].slice.call(arguments);//类数组转成数组 c.push(5); console.log(c); console.log(arguments); } a(1,2,3)
var a = [1,2,3], b = a.slice(0); a.push(5); console.log(a); console.log(b);
时间: 2024-10-13 03:32:33
function a(){ console.log(arguments.length); var c = [].slice.call(arguments);//类数组转成数组 c.push(5); console.log(c); console.log(arguments); } a(1,2,3)
var a = [1,2,3], b = a.slice(0); a.push(5); console.log(a); console.log(b);