Skip to content

symmetricDifference

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

Obtain entries not present in both ilists.

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


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

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

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


References

Clone this wiki locally