-
Notifications
You must be signed in to change notification settings - Fork 0
symmetricDifference
Subhajit Sahu edited this page Feb 4, 2021
·
14 revisions
Gives entries not present in both entries. 🏃 📼 📦 🌔 📒
Similar: union, intersection, difference, symmetricDifference, isDisjoint.
entries.symmetricDifference(x, y);
// x: entries
// y: another entries
const entries = require("extra-entries");
var x = [["a", 1], ["b", 2], ["c", 3], ["d", 4]];
var y = [["c", 30], ["d", 40], ["e", 50], ["f", 60]];
[...entries.symmetricDifference(x, y)];
// [ [ "a", 1 ], [ "b", 2 ], [ "e", 50 ], [ "f", 60 ] ]
var y = [["d", 40], ["e", 50], ["f", 60]];
[...entries.symmetricDifference(x, y)];
// [ [ "a", 1 ], [ "b", 2 ], [ "c", 3 ], [ "e", 50 ], [ "f", 60 ] ]