setUnion

setUnion(set1, set2)

Try it yourself:


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 for only common members and setSymDifference for only non-shared members.

Input notes

Union removes duplicate membership. Use concat when duplicates and source order must remain, and setSize to count the merged distinct result.

Try Set Union 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