public union(other as HashSet<T>) as HashSet<T>:
Returns a new set containing all elements from this set and other.
| Parameter | Description |
|---|---|
other | Elements to merge with this set. |
A new hash set containing the union.
import klyn.collections
left = {1, 2, 3}
right = {3, 4}
merged = left.union(right)
assert merged.size == 4
assert 4 in merged