Sometimes you want to transform only the keys in a Map, or only transform the values.
Kotlin has two useful methods to achieve this: mapKeys and mapValues.
You can use mapKeys to transform the keys of the map while keeping the values the same.
With mapValues you can transform the values of the map while keeping the keys the same.
Both methods accept a lambda function as asrgument of type Map.Entry and must return the new key or value.
In order to transform the keys or values and add the result to an existing Map you can use the methods mapKeysTo and mapValuesTo.
The first argument is the existing (mutable) Map and the second argument is the lambda function.