2.2.5 • Published 5 years ago
@extra-object/intersection-update v2.2.5
Gives entries present in both objects. :running: :package: :ledger:
Similar: union, intersection, difference, symmetricDifference, isDisjoint. This is part of package extra-object.
object.intersection$(x, y, [fc]);
// x: an object (updated)
// y: another object
// fc: combine function (a, b)
// --> x
const object = require('extra-object');
var x = {a: 1, b: 2, c: 3, d: 4};
var y = {b: 20, c: 30, e: 50};
object.intersection$(x, y);
// { b: 2, c: 3 }
x;
// { b: 2, c: 3 }
var x = {a: 1, b: 2, c: 3, d: 4};
object.intersection$(x, y, (a, b) => b);
// { b: 20, c: 30 }