Maps
Explore how to work with maps in Kotlin collections to manage key-value associations. Understand how to create, retrieve, add, and remove entries in maps while utilizing generics for flexible types.
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. ...