mapIndex<T> method

List<T> mapIndex<T>(
  1. T f(
    1. int index,
    2. E e
    )
)

Implementation

List<T> mapIndex<T>(T f(int index, E e)) {
  List<T> result = <T>[];
  this.forIndex((element, index) {
    T t = f(index, element);
    result.add(t);
  });
  return result;
}