Skip to content
Subhajit Sahu edited this page May 3, 2023 · 21 revisions

Add value to the end.

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


function push(x, ...vs)
// x:  an array
// vs: values to add
const xarray = require('extra-array');

var x = [1, 2];
xarray.push(x, 3);
// → [ 1, 2, 3 ]

xarray.push(x, 3, 4);
// → [ 1, 2, 3, 4 ]


References

Clone this wiki locally