core3-utils

@wixc3/common on Github

Home > @wixc3/common > unique

unique() function

Creates iterable of unique elements

Signature:

export declare function unique<T>(iterable: Nullable<Iterable<T>>, by?: Predicate<T, unknown>): Iterable<T>;

Parameters

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>