1
0
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:
Miccah 2021-03-20 11:27:27 -05:00 committed by GitHub
parent f9bbc119aa
commit a2eb686506
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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