Skip to content
Subhajit Sahu edited this page May 11, 2020 · 21 revisions

Removes first value. 🏃 📼 📦 🌔

Alternatives: default, update.
Similar: push, pop, shift, unshift.

array.shift(x);
// x: an array
// --> [value, array]
const array = require('extra-array');

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

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

references

Clone this wiki locally