Skip to content

concat$

Subhajit Sahu edited this page Dec 8, 2022 · 12 revisions

Combines entries from objects, preferring last.

Alternatives: concat, concat$.
Similar: concat, join.


function concat$(x, ...ys)
// x:  an object (updated)
// ys: other objects
const object = require('extra-object');

var x = {a: 1, b: 2};
var y = {c: 3, d: 4};
object.concat$(x, y);
// → { a: 1, b: 2, c: 3, d: 4 }

x;
// → { a: 1, b: 2, c: 3, d: 4 }

var x = {a: 1, b: 2};
var z = {d: 40, e: 50};
object.concat$(x, y, z);
// → { a: 1, b: 2, c: 3, d: 40, e: 50 }


References

Clone this wiki locally