Set
Definition
A built-in collection that stores unique values of any type. Duplicate values are automatically ignored. Sets provide O(1) add/delete/has operations and are useful for deduplication.
Code Example
Javascript
Tip: Modify the code above and click “Run” to see the results
Learn More
Related Terms
Map
A built-in collection that stores key-value pairs where keys can be any type (not just strings). Maps maintain insertion order and provide O(1) lookup. Unlike plain objects, Maps don't have prototype pollution concerns.
Array MethodsBuilt-in methods on the Array prototype for transforming and querying arrays. Key methods include map (transform each element), filter (select elements), reduce (accumulate), find (first match), some/every (boolean tests), and sort.