method List.count
The number of elements for which p is true.
Example:
fn main() io {
print("{[1, 2, 3, 4].count(x => x > 1)}")
}Output
3
pub(api) fn count<effect F>(p: fn(T) -> bool F) -> usize FSince. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
p | fn(T) -> bool F |
Returns
usize F
Effects
none declared (pure unless the body says otherwise)
Defined in: std/core/collections.oxl:523