setSymDifference

setSymDifference(set1, set2)

Try it yourself:


Find non-shared members with setSymDifference

setSymDifference(A, B) returns values that belong to exactly one of two sets. Shared values are removed.

Example

For {1,2,3} and {2,3,4}, the symmetric difference is {1,4}. Use setDifference for one directional exclusion and setIntersect to identify what was shared.

Caveats

Duplicates do not change set membership. Normalize sources with setDistinct, and use setUnion if both unique and shared values should be retained.

Try Set Sym Difference in Calcul.io

Start with one of the editable examples above, then replace its arguments with your own values. Keeping the function on a separate calculator line makes the input and result easy to compare. For a longer workflow, assign the result to a variable or reference that line in the next expression.

Check the shown signature before adding optional arguments, and use the related-function links to compare operations with similar purposes.

All functions