# setUnion() Function & Examples

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

## setUnion

#### setUnion(set1, set2)

Try it yourself:

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

---

## Combine set members with setUnion

**setUnion(A, B)** returns every distinct member found in either set. It is the natural operation for merging tags, permissions, or candidate lists.

## Example

The union of {1,2} and {2,3} is {1,2,3}. Use [setIntersect](https://calcul.io/function/setIntersect/index.md) for only common members and [setSymDifference](https://calcul.io/function/setSymDifference/index.md) for only non-shared members.

## Input notes

Union removes duplicate membership. Use [concat](https://calcul.io/function/concat/index.md) when duplicates and source order must remain, and [setSize](https://calcul.io/function/setSize/index.md) to count the merged distinct result.

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