Skip to content
Subhajit Sahu edited this page Jun 17, 2020 · 14 revisions

Appends entries from maps, preferring last. 🏃 📼 📦 🌔 📒

Alternatives: concat, concat$.

entries.concat(...xs);
// xs: n entries
const entries = require('extra-entries');

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

var z = [['d', 40], ['e', 50]];
[...entries.concat(x, y, z)];
// [ [ 'a', 1 ], [ 'b', 2 ], [ 'c', 3 ], [ 'd', 40 ], [ 'e', 50 ] ]

references

Clone this wiki locally