Skip to content
Subhajit Sahu edited this page Nov 20, 2022 · 22 revisions

Remove last value.

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


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

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

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


References

Clone this wiki locally