Skip to main content

uniq

Removes duplicates from an array by leaving only one identical value. Same is determined by the SameValueZero operation.

uniq<T>(
// Array to remove duplicates from
arr: T[]
): T[]

Example

uniq([1, 2, 2, 3]); // [1, 2, 3]