ES6扩展运算符的数组合并

let _arr1=['a','b','c'];
let _arr2=['d','e','f'];
let _arr3=[..._arr1,..._arr2];
console.log(_arr3);

//输出  ["a", "b", "c", "d", "e", "f"]

扩展:删除数组元素

let _lists=[
    {id:1,name:'a'},
    {id:2,name:'b'},
    {id:3,name:'c'}
];
_lists.splice(_lists.findIndex(item=>item.id==2),1);
console.log(_lists);


//输出  [{id:1,name:'a'},{id:3,name:'c'}]