forEachIndexed method
Performs the given action
on each element, providing sequential index
with the element.
Implementation
void forEachIndexed(void Function(int index, E element) action) {
var index = 0;
forEach((element) => action(index++, element));
}