docs: add example for map's `.keys()` method (#11397)

pull/8802/head^2
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
1 changed files with 1 additions and 0 deletions

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.