JavaScript: Array.prototype.pop

By Xah Lee. Date: . Last updated: .
arrayX.pop()
Remove and return the last item. If arrayX is empty, return undefined.
const ar = [3,4];

console.log( ar.pop() ); // 4

console.log( ar ); // [ 3 ]

[see Array.prototype.push]

JS in Depth
XAH  BUY NOW

JS in Depth

JS Obj Ref

DOM


JS Obj Ref

Array

prototype