Returns unique elements of the given array.

Type signature

<T>(xs: T[]) => T[]

Examples

unique([1, 2, 3, 4, 3, 4, 3, 6]);
// ⇒ [1, 2, 3, 4, 6]
Try in REPL

Questions

  • How to find all unique values in an array?

TypeScript sourceJavaScript source