Home > @infiniteobjects/core-library-node > Arrays > uniqBy
This method is like Arrays.uniq except that it accepts iteratee which is invoked for each element in collection to generate the criterion by which uniqueness is computed.
Signature:
static uniqBy<T, R = unknown>(collection: T[], iteratee: (item: T) => R): T[];
| Parameter | Type | Description |
|---|---|---|
| collection | T[] | |
| iteratee | (item: T) => R |
Returns:
T[]
Is the consumer responsability to provide an iteratee that create unique values