https://kotlinlang.org logo
Title
c

christophsturm

07/06/2018, 2:52 PM
why does the mapValues[To] method pass the map entry and not only the key to the transform function?
l

leolima

07/06/2018, 2:59 PM
Returns a new map with entries having the keys of this map and the values obtained by applying the [transform] function to each entry in this [Map].
c

christophsturm

07/06/2018, 3:01 PM
yes i know. mapValues just sounds like it transforms the values
n

Nikky

07/06/2018, 3:06 PM
but you may want to tranform the values with the key as input, its not much more work to get the value from a entry.. but much more work to get the key from all entries when you just know the value
☝️ 1