Kotlin HashMap toMutableMap()
Syntax & Examples


Syntax of HashMap.toMutableMap()

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

fun <K, V> Map<out K, V>.toMutableMap(): MutableMap<K, V>

This toMutableMap() extension function of HashMap returns a new mutable map containing all key-value pairs from the original map.