Skip to content

uniq

uniq<T>(iterable, comparisonStrategy?): IterableIterator<T>

Defined in: set/uniq.ts:15

Yields each distinct value of an iterable, in first-occurrence order.

Time complexity: O(n) under the default "sameValueZero" strategy. Any other strategy is O(n²).

T extends DefinedValue

Iterable<T>

The input iterable.

EqualityComparisonStrategy<T, T> = "sameValueZero"

The equality comparison strategy to use (default is “sameValueZero”).

IterableIterator<T>

An iterator over the distinct values.