【JavaScript】配列操作 先頭を削除 shift
配列操作 先頭を削除 shift
構文 配列.shift(); 例 let colors = ['Red', 'Yellow', 'Blue']; console.log(colors); #=>["Red", "Yellow", "Blue"] colors.shift(); console.log(colors); #=>["Yellow", "Blue"]
構文 配列.shift(); 例 let colors = ['Red', 'Yellow', 'Blue']; console.log(colors); #=>["Red", "Yellow", "Blue"] colors.shift(); console.log(colors); #=>["Yellow", "Blue"]