Kotlin HashMap mapTo()
Syntax & Examples


Syntax of HashMap.mapTo()

The syntax of HashMap.mapTo() extension function is:

fun <K, V, R, C : MutableCollection<in R>> Map<out K, V>.mapTo( destination: C, transform: (Entry<K, V>) -> R ): C

This mapTo() extension function of HashMap applies the given transform function to each entry of the original map and appends the results to the given destination.