接著是foreach,基本語法為function(item,index,array) let arr = [1,2,4,5,8] let useforeach = arr.forEach((item,index) => arr[index] = item*2)
確定! 回上一頁