Hash Map
Definition
A data structure that maps keys to values using a hash function for O(1) average-case lookups, insertions, and deletions. In JavaScript, plain objects and the `Map` class serve as hash maps.
Code Example
Learn More
Related Terms
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.
SetA 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.
Big O NotationA mathematical notation that describes the upper bound of an algorithm's time or space complexity as input size grows. Common complexities from fastest to slowest: O(1), O(log n), O(n), O(n log n), O(n^2), O(2^n).