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

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