shift()
is ideal for your situation.
(shift()
非常适合您的情况。)
shift()
removes the first element from an array and returns that element.(shift()
从数组中删除第一个元素并返回该元素。)
This method changes the length of the array.(此方法更改数组的长度。)
array = [1, 2, 3, 4, 5];
array.shift(); // 1
array // [2, 3, 4, 5]
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…