mapIndexed<TResult> method
Returns an Iterable containing the results of all elements processed
by the toElement
function.
This method works like map
but provides the toElement
function with
the elements index as second argument.
Implementation
Iterable<TResult> mapIndexed<TResult>(
TResult Function(TValue, int) toElement) sync* {
var i = 0;
for (final e in this) {
yield toElement(e, i++);
}
}