I see that to iterate in each key value pair is:
map.forEach { key, value -> println("$key = $value") }
How do I iterate and get all the values for each key - Something like...
map.forEach { key -> println("$key") }
thanks
I see that to iterate in each key value pair is:
map.forEach { key, value -> println("$key = $value") }
How do I iterate and get all the values for each key - Something like...
map.forEach { key -> println("$key") }
thanks
There's myMap.keys and myMap.values if you just want to iterate over one of those. And myMap.entries if you want the actual Entry object, where your forEach variable would need to be { (key, value) -> } instead (i.e. a single variable with two components)