doc: document array .any() and .all() (#9386)

pull/9393/head
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
1 changed files with 9 additions and 0 deletions

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.