-
Notifications
You must be signed in to change notification settings - Fork 3
symmetricDifference
Subhajit Sahu edited this page Dec 8, 2022
·
14 revisions
Obtain entries not present in both objects.
Alternatives: symmetricDifference, symmetricDifference$.
Similar: isDisjoint, union, intersection, difference, symmetricDifference.
function symmetricDifference(x, y)
// x: an object
// y: another object
const object = require('extra-object');
var x = {a: 1, b: 2, c: 3, d: 4};
var y = {c: 30, d: 40, e: 50, f: 60};
object.symmetricDifference(x, y);
// → { a: 1, b: 2, e: 50, f: 60 }
var y = {d: 40, e: 50, f: 60};
object.symmetricDifference(x, y);
// → { a: 1, b: 2, c: 3, e: 50, f: 60 }