-
Notifications
You must be signed in to change notification settings - Fork 1
shift
Subhajit Sahu edited this page Feb 3, 2021
·
21 revisions
Removes first value.
Similar: [push], [pop], [shift], [unshift].
xiterable.shift(x);
// x: an iterable
const xiterable = require('extra-iterable');
var x = [1, 2, 3];
[...xiterable.shift(x)];
// → [2, 3]
var x = [1, 2, 3, 4];
[...xiterable.shift(x)];
// → [2, 3, 4]