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]

JavaScript: Array, add/remove items

BUY
ΣJS
JavaScript in Depth

JS Obj Reference

Array

prototype