onEachIndexed method
Performs the given action
on each element, providing sequential index
with the element, and returns the collection itself afterwards.
Implementation
Iterable<E> onEachIndexed(void Function(int index, E element) action) {
var index = 0;
for (final element in this) {
action(index++, element);
}
return this;
}