As we have already learned, a set is a collection of distinct elements (non-repeated elements). A dictionary is used to store [key, value] pairs, where the key could be used to find a particular element. A dictionary is very similar to a set; a set stores a [key, key] collection of elements, and a dictionary stores a [key, value] collection of elements. A dictionary is also known as a map, symbol table, and an associative array.
In computer science, dictionaries are often used to store the reference address of objects. For example, if we open the Chrome | Developer tools in the Memory tab and run a snapshot, we will be able to see some objects and their respective address references in the memory (represented by @<number>). We can see this scenario in the following screenshot:
![](https://static.packt-cdn.com/products/9781788623872/graphics/assets/d37a925f-1290-4b87-93c3-81fed909b0c8.png)
In this chapter, we will also cover some examples of how...