-
Notifications
You must be signed in to change notification settings - Fork 5
unshift
Subhajit Sahu edited this page Mar 14, 2020
·
22 revisions
Adds values to the start.
array.unshift(x, ...vs);
// x: an array
// vs: values to add
// --> unshifted
const array = require('extra-array');
array.unshift([3, 4], 2);
// [ 2, 3, 4 ]
array.unshift([3, 4], 1, 2);
// [ 1, 2, 3, 4 ]