* @returns a new Set containing all the elements in this Set which are not also in the argument.
(other: ReadonlySet<T>)
| 192 | * @returns a new Set containing all the elements in this Set which are not also in the argument. |
| 193 | */ |
| 194 | public difference(other: ReadonlySet<T>): Set<T> { |
| 195 | const result = new Set<T>(this); |
| 196 | for (const item of other) { |
| 197 | result.delete(item); |
| 198 | } |
| 199 | return result; |
| 200 | } |
| 201 | |
| 202 | /** |
| 203 | * @returns a new Set containing all the elements which are in either this Set or in the argument, but not in both. |