mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
docs: add example for map's .keys()
method (#11397)
This commit is contained in:
parent
aefe267970
commit
51410b0922
@ -1043,6 +1043,7 @@ m['two'] = 2
|
||||
println(m['one']) // "1"
|
||||
println(m['bad_key']) // "0"
|
||||
println('bad_key' in m) // Use `in` to detect whether such key exists
|
||||
println(m.keys()) // ['one', 'two']
|
||||
m.delete('two')
|
||||
```
|
||||
Maps can have keys of type string, rune, integer, float or voidptr.
|
||||
|
Loading…
Reference in New Issue
Block a user