-
Notifications
You must be signed in to change notification settings - Fork 1
unshift
Subhajit Sahu edited this page Feb 3, 2021
·
21 revisions
Add values to the start.
function unshift(x, ...vs)
// x: an iterable
// vs: values to add
const xiterable = require('extra-iterable');
var x = [3, 4];
[...xiterable.unshift(x, 2)];
// → [2, 3, 4]
[...xiterable.unshift(x, 1, 2)];
// → [1, 2, 3, 4]