mapIndexed<R> method

List<R> mapIndexed<R>(
  1. R transform(
    1. int,
    2. T
    )
)

Returns a list containing the results of applying the given transform function to each element and its index in the original collection. @param transform function that takes the index of an element and the element itself and returns the result of the transform applied to the element.

Implementation

List<R> mapIndexed<R>(R Function(int, T) transform) {
  return mapIndexedTo([], transform);
}