mapIndexed<R> method

Iterable<R> mapIndexed<R>(
  1. R convert(
    1. int index,
    2. E element
    )
)

Maps each element and its index to a new value.

Implementation

Iterable<R> mapIndexed<R>(R Function(int index, E element) convert) sync* {
  for (var index = 0; index < length; index++) {
    yield convert(index, this[index]);
  }
}