📌  相关文章
📜  从数组中删除元素 javascript 代码示例

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

代码示例6
let numbers = [1,2,3,4]

// to remove last element
let lastElem = numbers.pop()

// to remove first element
let firstElem = numbers.shift()

// both these methods modify array while returning the removed element