Loading
A collection that only holds unique values. Adding a duplicate does nothing.
A built-in JavaScript collection that stores unique values of any type. Primary methods: add, has, delete, clear. Iterates in insertion order. `[...new Set(arr)]` is the standard deduplication idiom.
Implemented as a hash set with O(1) average-case add/has/delete. Uses the SameValueZero comparison algorithm (like === but treats NaN as equal to NaN). No index access — convert to array if you need positions.