let arr = [1, 2, 3]; arr.forEach((el, i, a) => { if (i === 2) return; a[i] = el * 2 }); alert(arr.join())