union($set1,$set2, ..., $setN)
Calculates the union of the sets set1,... setN.
| Name | Type | Description | Mandatory | Default |
|---|---|---|---|---|
| set | Set | Sets that are to be combined into a single set. | yes |
Type: Set
A set containing all elements of the sets set1,... setN. No duplicates will be added, even if multiple sets contain the same elements.
union(list(1, 2, 3), list(4, 5, 6), list(7, 8, 9))
Output: A set with the elements [1, 2, 3, 4, 5, 6, 7, 8, 9].
union(list(1, 2, 3), list(1, 2, 3, 4, 5))
Output: A set with the elements [1, 2, 3, 4, 5].
The numbers 1 and 2 are added only once, because a set must not contain duplicates.