RosettaCodeData/Task/Associative-array-Iteration/Kotlin/associative-array-iteration.kts
2024-10-16 18:07:41 -07:00

9 lines
260 B
Kotlin

fun main() {
val map = mapOf("hello" to 1, "world" to 2, "!" to 3)
with(map) {
forEach { println("key = ${it.key}, value = ${it.value}") }
keys.forEach { println("key = $it") }
values.forEach { println("value = $it") }
}
}