docs: add example for map's `.keys()` method (#11397)
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