We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Obtain entries present in any object.
Alternatives: union, union$. Similar: unionKeys, union. Similar: isDisjoint, union, intersection, difference, symmetricDifference.
function union$(x, y, fc) // x: an object (updated) // y: another object // fc: combine function (a, b)
const object = require('extra-object'); var x = {a: 1, b: 2, c: 3}; var y = {b: 20, c: 30, d: 40}; object.union$(x, y); // → { a: 1, b: 2, c: 3, d: 40 } x; // → { a: 1, b: 2, c: 3, d: 40 } var x = {a: 1, b: 2, c: 3}; object.union$(x, y, (a, b) => b); // → { a: 1, b: 20, c: 30, d: 40 }