Associative array/Iteration: Difference between revisions

→‎Kotlin: Shortened the code for better readability
m (→‎{{header|Sidef}}: simplified code)
(→‎Kotlin: Shortened the code for better readability)
Line 2,017:
 
=={{header|Kotlin}}==
<syntaxhighlight lang="scala">fun main(a: Array<String>) {
val map = mapOf("hello" to 1, "world" to 2, "!" to 3)
 
with(map) {
entries.forEach { println("key = ${it.key}, value = ${it.value}") }
keys.forEach { println("key = $it") }
values.forEach { println("value = $it") }
49

edits