Skip to content
Subhajit Sahu edited this page Feb 3, 2021 · 20 revisions

Add values to the end.

Similar: push, pop, shift, unshift.


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

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

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


References

Clone this wiki locally