uniq es-toolkit
Returns a new array with duplicate elements removed.
Usage
uniq(arr)
Use uniq when you want to remove duplicate values from an array and keep only unique values. It preserves the order in which they first appear in the original array.
It returns an empty array for an empty array.
Parameters
arrreadonly T[]required
The array from which to remove duplicates.
Returns
A new array with duplicates removed. Preserves the order in which they first appear in the original array.
Source: es-toolkit
Re-exported verbatim from es-toolkit. Implementation, edge cases, and performance behavior are owned upstream. This page mirrors the documentation at the pinned version; the linked source is authoritative.