MCPcopy Index your code
hub / github.com/TypeScriptToLua/TypeScriptToLua / symmetricDifference

Method symmetricDifference

src/lualib/Set.ts:205–215  ·  view source on GitHub ↗

* @returns a new Set containing all the elements which are in either this Set or in the argument, but not in both.

(other: ReadonlySet<T>)

Source from the content-addressed store, hash-verified

203 * @returns a new Set containing all the elements which are in either this Set or in the argument, but not in both.
204 */
205 public symmetricDifference(other: ReadonlySet<T>): Set<T> {
206 const result = new Set<T>(this);
207 for (const item of other) {
208 if (this.has(item)) {
209 result.delete(item);
210 } else {
211 result.add(item);
212 }
213 }
214 return result;
215 }
216
217 /**
218 * @returns a boolean indicating whether all the elements in this Set are also in the argument.

Callers

nothing calls this directly

Calls 3

hasMethod · 0.95
deleteMethod · 0.95
addMethod · 0.95

Tested by

no test coverage detected