Logo

Programming-Idioms

History of Idiom 8 > diff from v70 to v71

Edit summary for version 71 by hover:
New Kotlin implementation by user [hover]

Version 70

2020-04-29, 09:24:22

Version 71

2020-04-29, 09:26:44

Idiom #8 Initialize a new map (associative array)

Declare a new map object x, and provide some (key, value) pairs as initial content.

Idiom #8 Initialize a new map (associative array)

Declare a new map object x, and provide some (key, value) pairs as initial content.

Extra Keywords
table dictionary hash
Extra Keywords
table dictionary hash
Code
val x = mapOf<String, Integer>()
x["one"] = 1
x["two"] = 2
Doc URL
https://kotlinlang.org/docs/reference/constructing-collections.html