> a=[1,2,3,4,5] [1, 2, 3, 4, 5] > a.forEach((v, k) => { if (k == 2) a.splice(k, 1); console.log(v); }) 1 2 3 5 undefined