why does the mapValues[To] method pass the map ent...
# announcements
c
why does the mapValues[To] method pass the map entry and not only the key to the transform function?
l
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
yes i know. mapValues just sounds like it transforms the values
n
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