intersection
intersection<
T>(iterables,comparisonStrategy?):Iterable<T>
Defined in: set/intersection.ts:17
Computes the intersection of any number of iterables.
Time complexity: O(n) total across every source iterable — one Set is built
per iterable after the first, and the running result is filtered against it,
rather than re-scanning an array per candidate (which would make this
quadratic). That holds under the default "sameValueZero".
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”iterables
Section titled “iterables”readonly Iterable<T, any, any>[]
The iterables to intersect.
comparisonStrategy?
Section titled “comparisonStrategy?”EqualityComparisonStrategy<T, T> = "sameValueZero"
The equality comparison strategy to use.
Returns
Section titled “Returns”Iterable<T>
An iterable containing only the elements common to every input iterable.