Maps
Learn how to use maps, find values using keys, and add new elements to maps.
Key-value mapping
We use maps to keep associations from keys to their values. For instance:
From user ID to an object representing the user
From a website to its IP address
From a configuration name to data stored in this configuration
Creating maps
We can create a map using the mapOf function and then use key-value pairs as arguments to specify key-value associations. For instance, we might define a map that associates countries with their capital cities. Pairs can be defined using a constructor or the to function.
...