A dictionary is a data structure that stores key–value pairs, allowing fast lookups, updates, and deletions based on a unique key. Dictionaries are known as objects in JavaScript, maps in Go, and hash maps in many other languages. Internally, they are often implemented using hash tables. Dictionaries make it easy to model entities with named attributes, such as user profiles or configuration settings.
Why it matters
Dictionaries offer O(1) average lookup time, making them ideal for caching, configuration, and fast data retrieval. They are foundational to most programming languages and repeatedly appear in APIs, settings, and internal data models.
Examples
Storing user session data in a dictionary or mapping product IDs to product details are common uses. Lessons like What Is a Dictionary? and Accessing Dictionary Values show how they work.