Returns an array with no repeated elements.
The array to extract distinct elements from
A new array containing only distinct elements
const unique = distinct([1, 1, 2, 3]); Copy
const unique = distinct([1, 1, 2, 3]);
Returns a mapped array with no repeated elements.
Optional mapping function to apply before checking for distinctness
Optional
Optional this context for the mapping function
const uniqueIds = distinct(users, user => user.id); Copy
const uniqueIds = distinct(users, user => user.id);
Returns an array with no repeated elements.