# setSymDifference() Function & Examples

Use the setSymDifference() set function in Calcul.io. Review its syntax, edit working examples, understand the result, and explore related math functions.

## setSymDifference

#### setSymDifference(set1, set2)

Try it yourself:

```calculio
setSymDifference([1, 2, 3, 4], [3, 4, 5, 6])
setSymDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])
```

---

## 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](https://calcul.io/function/setDifference/index.md) for one directional exclusion and [setIntersect](https://calcul.io/function/setIntersect/index.md) to identify what was shared.

## Caveats

Duplicates do not change set membership. Normalize sources with [setDistinct](https://calcul.io/function/setDistinct/index.md), and use [setUnion](https://calcul.io/function/setUnion/index.md) if both unique and shared values should be retained.

[All functions](https://calcul.io/functions/index.md)
