📅  最后修改于: 2022-03-11 15:01:40.190000             🧑  作者: Mango
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