RosettaCodeData/Task/Associative-array-Iteration/Kotlin/associative-array-iteration.kotlin
2024-03-06 22:25:12 -08:00

9 lines
260 B
Text

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") }
}
}