es6的方法就是使用扩展运算符
function f(){ let a=Array.from(arguments) let b=Array.prototype.concat.apply([],arguments) let c=[...arguments] let d=Array.prototype.slice.apply(arguments) let e=[].map.call(arguments,o=>o) console.log(a,b,c,d,e) } f(1,2,3)
京公网安备 11010502049817号