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

Method intersection

src/lualib/Set.ts:181–189  ·  view source on GitHub ↗

* @returns a new Set containing all the elements which are both in this Set and in the argument.

(other: ReadonlySet<T>)

Source from the content-addressed store, hash-verified

179 * @returns a new Set containing all the elements which are both in this Set and in the argument.
180 */
181 public intersection(other: ReadonlySet<T>) {
182 const result = new Set<T>();
183 for (const item of this) {
184 if (other.has(item)) {
185 result.add(item);
186 }
187 }
188 return result;
189 }
190
191 /**
192 * @returns a new Set containing all the elements in this Set which are not also in the argument.

Callers

nothing calls this directly

Calls 2

addMethod · 0.95
hasMethod · 0.45

Tested by

no test coverage detected