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

Appends values from iterables. 🏃 📼 📦 🌔 📒

Similar: concat, join.


iterable.concat(...xs);
// xs: iterables
const iterable = require("extra-iterable");

var x = [1, 2];
var y = [3, 4];
[...iterable.concat(x, y)];
// [ 1, 2, 3, 4 ]

[...iterable.concat(x, y, y)];
// [ 1, 2, 3, 4, 3, 4 ]


References

Clone this wiki locally