onEach method

Iterable<E> onEach(
  1. void action(
    1. E element
    )
)

Returns a new lazy Iterable which performs the given action on each element.

Implementation

Iterable<E> onEach(void Function(E element) action) sync* {
  for (var element in this) {
    action(element);
    yield element;
  }
}