【JavaScript】配列操作 更新 配列値変更
配列操作 更新 配列値変更
構文 変数名[インデックス] = 値; 例 let colors = ['Red', 'Yellow', 'Blue']; console.log(colors); #=>["Red", "Yellow", "Blue"] colors[0] = 'Aka'; console.log(colors); #=>["Aka", "Yellow", "Blue"]
構文 変数名[インデックス] = 値; 例 let colors = ['Red', 'Yellow', 'Blue']; console.log(colors); #=>["Red", "Yellow", "Blue"] colors[0] = 'Aka'; console.log(colors); #=>["Aka", "Yellow", "Blue"]