forEachIndexed method

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

forEach with index

Implementation

void forEachIndexed(void action(int index, T element)) {
  int index = 0;

  for (T element in this) action(index++, element);
}