Skip to content

Commit

Permalink
docs: add nested map example. Closes #15751 (#15753)
Browse files Browse the repository at this point in the history
  • Loading branch information
Larpon committed Sep 14, 2022
1 parent ac64318 commit 0b2841d
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions doc/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ It is easy, and it takes only a few seconds:
[https://github.com/vlang/v#installing-v](https://github.com/vlang/v#installing-v---from-source-preferred-method)

## Upgrading V to latest version
If V is already installed on a machine, it can be upgrade to latest version
If V is already installed on a machine, it can be upgraded to its latest version
by using the V's built-in self-updater.
To upgrade the version run the command ` v up`
To do so, run the command `v up`.

## Table of Contents

Expand Down Expand Up @@ -1278,6 +1278,19 @@ val2 := arr[333]?
println(val2)
```

V also supports nested maps:
```v
mut m := map[string]map[string]int{}
m['greet'] = {
'Hello': 1
}
m['place'] = {
'world': 2
}
m['code']['orange'] = 123
print(m)
```

Maps are ordered by insertion, like dictionaries in Python. The order is a
guaranteed language feature. This may change in the future.

Expand Down

0 comments on commit 0b2841d

Please sign in to comment.