Skip to content

Commit 5996c26

Browse files
authored
Update 03_Map.md
Add note about usage of `to` which may be confusing to newcomers.
1 parent 22476e3 commit 5996c26

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/05_Collections/03_Map.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Map
22

3-
A [map](https://kotlinlang.org/docs/reference/collections.html) is a collection of key/value pairs, where each key is unique and is used to retrieve the corresponding value. For creating maps, there are functions `mapOf()` and `mutableMapOf()`. A read-only view of a mutable map can be obtained by casting it to `Map`.
3+
A [map](https://kotlinlang.org/docs/reference/collections.html) is a collection of key/value pairs, where each key is unique and is used to retrieve the corresponding value. For creating maps, there are functions `mapOf()` and `mutableMapOf()`. Using the [to](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/to.html) infix function makes initialization less noisy. A read-only view of a mutable map can be obtained by casting it to `Map`.
44

55
```run-kotlin
66
const val POINTS_X_PASS: Int = 15

0 commit comments

Comments
 (0)