Kotlin HashMap mapKeysTo()
Syntax & Examples
Syntax of HashMap.mapKeysTo()
The syntax of HashMap.mapKeysTo() extension function is:
fun <K, V, R, M : MutableMap<in R, in V>> Map<out K, V>.mapKeysTo( destination: M, transform: (Entry<K, V>) -> R ): M
This mapKeysTo() extension function of HashMap populates the given destination map with entries having the keys obtained by applying the transform function to each entry in this Map and the values of this map.