Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@extra-array/unshift-update

nodef73MIT2.10.19TypeScript support: included

Adds values to the start.

extra, array, unshift, update, unshift$

readme

Adds values to the start. :package: :smiley_cat: :running: :vhs: :moon: :scroll: :newspaper: :blue_book:

Alternatives: unshift, unshift$.
Similar: push, pop, shift, unshift.

This is part of package extra-array.


array.unshift$(x, ...vs);
// x:  an array (updated)
// vs: values to add
// → x
const array = require("extra-array");

var x = [3, 4];
array.unshift$(x, 2);
// [ 2, 3, 4 ]

x;
// [ 2, 3, 4 ]

var x = [3, 4];
array.unshift$(x, 1, 2);
// [ 1, 2, 3, 4 ]


References