Returns an array with any duplicates removed
function uniqueBy<T, U extends (arg: T) => any>(
arr: T[],
callback: U
): T[]
// Example:
uniqueBy([1, 2, 3, 4], (n) => n % 2) //=> [1, 2]
Returns an array with any duplicates removed
function uniqueBy<T, U extends (arg: T) => any>(
arr: T[],
callback: U
): T[]
// Example:
uniqueBy([1, 2, 3, 4], (n) => n % 2) //=> [1, 2]