method iter.forEach
Calls f for every element.
Example:
fn main() io {
[1, 2].iter().forEach(x => print("item {x}"))
}Output
item 1 item 2
pub(api) move fn forEach<effect F>(f: fn(T) F) FComplexity. O(n).
Since. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
f | fn(T) F |
Effects
none declared (pure unless the body says otherwise)
Defined in: std/core/iter.oxl:670