forEachIndex method

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

Implementation

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