forEachIndexed method

void forEachIndexed(
  1. void action(
    1. int index,
    2. E element
    )
)

Takes an action for each element.

Calls action for each element along with the index in the iteration order.

Implementation

void forEachIndexed(void Function(int index, E element) action) {
  for (var index = 0; index < length; index++) {
    action(index, this[index]);
  }
}