1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

docs: add nested map example. Closes #15751 (#15753)

This commit is contained in:
Larpon 2022-09-14 09:32:09 +02:00 committed by GitHub
parent ac64318890
commit 0b2841d4ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
@ -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.