-
Notifications
You must be signed in to change notification settings - Fork 1
shift
wolfram77 edited this page Mar 27, 2020
·
21 revisions
Removes first value.
Alternatives: default, update.
Similar: push, pop, shift, unshift.
iterable.shift(x);
// x: an iterable
// --> [value, iterable]
const iterable = require('extra-iterable');
var x = [1, 2, 3];
iterable.shift(x);
// [1, [2, 3]]
var x = [1, 2, 3, 4];
iterable.shift(x);
// [1, [2, 3, 4]]