shift() 方法从数组中删除第一个元素,并返回该元素的值。此方法更改数组的长度。

const list = [1, 2, 3, 4, 5];
list.shift(); // 1
list; // [2, 3, 4, 5]