mapWithIndex<B> method

Iterable<B> mapWithIndex<B>(
  1. B f(
    1. T t,
    2. int index
    )
)

Map Iterable from type T to type B using the index.

Implementation

Iterable<B> mapWithIndex<B>(B Function(T t, int index) f) =>
    foldLeftWithIndex([], (a, e, i) => [...a, f(e, i)]);