Skip to content
Subhajit Sahu edited this page Dec 28, 2022 · 16 revisions

Append entries from all lists, preferring last.


function concat(...xs)
// xs: all lists
const xlists = require('extra-lists');

var x = [['a', 'b'], [1, 2]];
var y = [['c', 'd'], [3, 4]];
xlists.concat(x, y).map(c => [...c]);
// → [ [ 'a', 'b', 'c', 'd' ], [ 1, 2, 3, 4 ] ]

var z = [['d', 'e'], [40, 50]];
// → [ [ 'a', 'b', 'c', 'd', 'd', 'e' ], [ 1, 2, 3, 4, 40, 50 ] ]


References

Clone this wiki locally