📌  相关文章
📜  es6 删除数组的第一个元素 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:56.143000             🧑  作者: Mango

代码示例2
var myarray = ["item 1", "item 2", "item 3", "item 4"];

//removes the first element of the array, and returns that element.
alert(myarray.shift());
//alerts "item 1"

//removes the last element of the array, and returns that element.
alert(myarray.pop());
//alerts "item 4"