OxL Reference

method iter.forEach

Calls f for every element.

Example:

oxl✓ checked in CI
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) F

Complexity. O(n).

Since. 1.0.0-beta

Parameters

NameType
ffn(T) F

Effects

none declared (pure unless the body says otherwise)

Defined in: std/core/iter.oxl:670

See also