[ad_1]
If you mean values, you can use the withDefault
function on any Map / MutableMap:
fun main() {
val map = mutableMapOf<String, Int>().withDefault { 9 }
map["hello"] = 5
println(map.getValue("hello"))
println(map.getValue("test"))
}
[ad_2]