* @returns a new Set containing all the elements in this Set and also all the elements in the argument.
(other: ReadonlySet<T>)
| 168 | * @returns a new Set containing all the elements in this Set and also all the elements in the argument. |
| 169 | */ |
| 170 | public union(other: ReadonlySet<T>): Set<T> { |
| 171 | const result = new Set<T>(this); |
| 172 | for (const item of other) { |
| 173 | result.add(item); |
| 174 | } |
| 175 | return result; |
| 176 | } |
| 177 | |
| 178 | /** |
| 179 | * @returns a new Set containing all the elements which are both in this Set and in the argument. |