Opposite of push(); [duplicate] Opposite of push(); [duplicate] arrays arrays

Opposite of push(); [duplicate]


push() adds at end; pop() deletes from end.

unshift() adds to front; shift() deletes from front.

splice() can do whatever it wants, wherever it wants.


Well, you've kind of asked two questions. The opposite of push() (as the question is titled) is pop().

var exampleArray = ['myName'];exampleArray.push('hi');console.log(exampleArray);exampleArray.pop();console.log(exampleArray);