mapIndexed<R> method

Iterable<R> mapIndexed<R>(
  1. R mapper(
    1. int,
    2. T
    )
)

Same as Iterable.map except that the mapper function also receives the index of the item being mapped

Implementation

Iterable<R> mapIndexed<R>(R Function(int, T) mapper) {
  var c = 0;
  return map((element) => mapper(c++, element));
}