[js]展开运算符
function f(...args){
console.log(args);
}
f(1,2,3,4,5)
[...args] = [1,2,3,4]
function f(...args){
console.log(args);
}
let arr = [1,2,3,4]
f(...arr)
[a,...args] = [1,2,3,4]
function f(a, ...args){
console.log(a, args);
}
let arr = [1,2,3,4]
f(...arr)