//数组的分割
var [b,c,...a] = [2222, 1, 2,3,333,5,6];
console.log(a) // [1, 2]
//数组的拷贝
var a = [1, 2];
var b = [...a];
console.log(b)
//对象中的使用
let { x, y, ...z } = { x: 1, y: 2, a: 3, b: 4 };
console.log(z) // {a: 3, b: 4}
//函数参数中使用
function test(...args) {
console.log(args);
}
test('wang', '23', 'man');