1
0
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:
zakuro 2021-09-06 00:23:04 +09:00 committed by GitHub
parent aefe267970
commit 51410b0922
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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