forEachIndexed method
Invokes action for each element together with its index.
Example:
['a', 'b'].forEachIndexed((i, v) => print('$i: $v'));
Implementation
void forEachIndexed(void Function(int index, E element) action) {
int index = 0;
for (final E element in this) {
action(index++, element);
}
}