Skip to content

symmetricDifference

Subhajit Sahu edited this page Dec 22, 2022 · 14 revisions

Obtain ientries not present in both ientries.

Similar: union, intersection, difference, symmetricDifference, isDisjoint.


function symmetricDifference(x, y)
// x: ientries
// y: another ientries
const ientries = require('extra-ientries');

var x = [["a", 1], ["b", 2], ["c", 3], ["d", 4]];
var y = [["c", 30], ["d", 40], ["e", 50], ["f", 60]];
[...ientries.symmetricDifference(x, y)];
// → [ [ "a", 1 ], [ "b", 2 ], [ "e", 50 ], [ "f", 60 ] ]

var y = [["d", 40], ["e", 50], ["f", 60]];
[...ientries.symmetricDifference(x, y)];
// → [ [ "a", 1 ], [ "b", 2 ], [ "c", 3 ], [ "e", 50 ], [ "f", 60 ] ]


References

Clone this wiki locally