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

Remove first value.

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


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

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

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


References

Clone this wiki locally