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

Removes first value. 🏃 📼 📦 🌔

Similar: push, pop, shift, unshift.

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

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

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

references

Clone this wiki locally