-
Notifications
You must be signed in to change notification settings - Fork 1
unshift
wolfram77 edited this page Mar 27, 2020
·
21 revisions
Adds values to the start.
iterable.unshift(x, ...vs);
// x: an iterable
// vs: values to add
// --> iterable
const iterable = require('extra-iterable');
var x = [3, 4];
[...iterable.unshift(x.values(), 2)];
// [ 2, 3, 4 ]
[...iterable.unshift(x.values(), 1, 2)];
// [ 1, 2, 3, 4 ]