Const
Yields only the first occurrence of each value from the source iterable.
Curried version of _distinct.
Element type produced by the source iterable.
Optional
Optional factory supplying the set used to track seen values.
A deferred iterable yielding each distinct value while preserving order.
Error Rethrows any error thrown by setFactory.
setFactory
const unique = [..._distinct([1, 1, 2, 3])];console.log(unique); // [1, 2, 3] Copy
const unique = [..._distinct([1, 1, 2, 3])];console.log(unique); // [1, 2, 3]
or using the curried version:
const unique = [...pipeInto([1, 1, 2, 3], distinct())];console.log(unique); // [1, 2, 3] Copy
const unique = [...pipeInto([1, 1, 2, 3], distinct())];console.log(unique); // [1, 2, 3]
Yields only the first occurrence of each value from the source iterable.
Curried version of _distinct.