mapIndexed<R> method
Behaves like the map function but also exposes the index of the current element.
Implementation
Iterable<R> mapIndexed<R>(R Function(int index, T element) f) sync* {
final iter = iterator;
int index = 0;
while (iter.moveNext()) {
yield f(index++, iter.current);
}
}