//數(shù)組的分割
var [b,c,...a] = [2222, 1, 2,3,333,5,6];
console.log(a) // [1, 2]
//數(shù)組的拷貝
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}
//函數(shù)參數(shù)中使用
function test(...args) {
console.log(args);
}
test('wang', '23', 'man');