📜  数组从数组中删除索引 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:58.350000             🧑  作者: Mango

代码示例3
// remove element at certain index without changing original
let arr = [0,1,2,3,4,5]
let newArr = [...arr]
newArr.splice(1,1)//remove 1 element from index 1
console.log(arr) // [0,1,2,3,4,5]
console.log(newArr)// [0,2,3,4,5]