📌  相关文章
📜  删除数组 javascript 代码示例中索引处的项目

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

代码示例1
// 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]