📌  相关文章
📜  如何选择数组中除第 i 个元素之外的所有其他值? - Javascript代码示例

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

代码示例1
// How to select all other values in an array except the ith element in Javascript
// Remove first index element
let orignalArray = [0,1,2,3,4,5];
let cloneArray = orignalArray.slice();
let i = 1;
cloneArray.splice(i,1);
console.log(cloneArray);
// Result: [ 0, 2, 3, 4, 5 ]