mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
doc: document array .any() and .all() (#9386)
This commit is contained in:
parent
f9bbc119aa
commit
a2eb686506
@ -713,6 +713,15 @@ println(upper_fn) // ['HELLO', 'WORLD']
|
||||
|
||||
`it` is a builtin variable which refers to element currently being processed in filter/map methods.
|
||||
|
||||
Additionally, `.any()` and `.all()` can be used to conveniently test
|
||||
for elements that satisfy a condition.
|
||||
|
||||
```v
|
||||
nums := [1, 2, 3]
|
||||
println(nums.any(it == 2)) // true
|
||||
println(nums.all(it >= 2)) // false
|
||||
```
|
||||
|
||||
#### Multidimensional Arrays
|
||||
|
||||
Arrays can have more than one dimension.
|
||||
|
Loading…
Reference in New Issue
Block a user