mapWithIndex<B> method
Same as map but provides also the index of each mapped
element in the mapping function (toElement).
Implementation
Iterable<B> mapWithIndex<B>(B Function(T t, int index) toElement) sync* {
var index = 0;
for (final value in this) {
yield toElement(value, index);
index += 1;
}
}