forEachIndex method

void forEachIndex(
  1. void f(
    1. E,
    2. int
    )
)

Implementation

void forEachIndex(void Function(E, int) f) {
  var i = 0;
  forEach((e) => f(e, i++));
}