mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
doc: improve in
documentation for maps (#17918)
This commit is contained in:
parent
6acf01a4a0
commit
88f89bde4e
@ -1762,10 +1762,17 @@ To do the opposite, use `!in`.
|
||||
nums := [1, 2, 3]
|
||||
println(1 in nums) // true
|
||||
println(4 !in nums) // true
|
||||
```
|
||||
|
||||
> **Note**
|
||||
> `in` checks if map contains a key, not a value.
|
||||
|
||||
```v
|
||||
m := {
|
||||
'one': 1
|
||||
'two': 2
|
||||
}
|
||||
|
||||
println('one' in m) // true
|
||||
println('three' !in m) // true
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user