-
Notifications
You must be signed in to change notification settings - Fork 1
symmetricDifference$
Subhajit Sahu edited this page Dec 2, 2022
·
10 revisions
Obtain values not present in both sets.
Alternatives: symmetricDifference, symmetricDifference$.
Similar: union, intersection, difference, symmetricDifference, isDisjoint.
function symmetricDifference$(x, y)
// x: a set (updated)
// y: another set
const set = require('extra-set');
var x = new Set([1, 2, 3, 4]);
var y = new Set([3, 4, 5, 6]);
set.symmetricDifference$(x, y);
// → Set(4) { 1, 2, 5, 6 }
x;
// → Set(4) { 1, 2, 5, 6 }
var x = new Set([1, 2, 3, 4]);
var y = new Set([4, 5, 6]);
set.symmetricDifference$(x, y);
// → Set(5) { 1, 2, 3, 5, 6 }
- Data.List.\: Haskell
- Data.Set.difference: Haskell
- Set.difference: Python
- _.difference: lodash
- _.differenceBy: lodash
- _.differenceWith: lodash
- Array.remove: sugarjs
- Applying the symmetric difference to multiple sets
- @thi.ng/associative: @thi-ng
- zet: @terkelg
- set-utils: @torbs
- set-tools: @ryanmcdermott
- Python Sets: w3schools
- Data.Set: Haskell
- Set: MDN web docs