//遍历映射,一次获取键和值 var map = hashMapOf(1 to "foo", 2 to "bar", 3 to "baz") for ((key, value) in map) { println("Map[$key] = $value") }