编辑代码

const arr = [1,2,3,4,5,6,7,8,9];
arr.forEach((x,i,array) => array[i]++);
console.log(arr)

// 稀疏函数
let arr2 = [1,2,3,,,9]