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