Skip to content
Subhajit Sahu edited this page May 3, 2023 · 22 revisions

Remove last value.

Alternatives: pop, pop$.
Similar: push, pop, shift, unshift.


function pop(x)
// x: an array
const xarray = require('extra-array');

var x = [1, 2, 3];
xarray.pop(x);
// → [ 1, 2 ]

var x = [1, 2, 3, 4];
xarray.pop(x);
// → [ 1, 2, 3 ]


References

Clone this wiki locally