Associative array/Iteration: Difference between revisions
Content added Content deleted
(Kotlin: with block idiom) |
|||
Line 1,406: | Line 1,406: | ||
val map = mapOf("hello" to 1, "world" to 2, "!" to 3) |
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") } |
|||
⚫ | |||
} |
|||
}</lang> |
}</lang> |
||
{{Out}} |
{{Out}} |