Home > @wixc3/common > unique
Creates iterable of unique elements
Signature:
export declare function unique<T>(iterable: Nullable<Iterable<T>>, by?: Predicate<T, unknown>): Iterable<T>;
Parameter | Type | Description |
---|---|---|
iterable | [Nullable](/core3-utils/common.nullable.html)<Iterable<T>> | |
by | [Predicate](/core3-utils/common.predicate.html)<T, unknown> | _(Optional)_ an element identifier (hash) function |
Returns:
Iterable<T>