// Iterate over entries (most common)
fun main() {
val map = mapOf("d" to 4, "a" to 1, "c" to 3, "b" to 2 )
for (entry in map.entries) {
println("Key: ${entry.key}, Value: ${entry.value}")
}
}
/*
run:
Key: d, Value: 4
Key: a, Value: 1
Key: c, Value: 3
Key: b, Value: 2
*/