mapWithIndex<A> method

Map<K, A> mapWithIndex<A>(
  1. A update(
    1. V value,
    2. int index
    )
)

Convert each value of the Map using the update function and returns a new Map.

Implementation

Map<K, A> mapWithIndex<A>(A Function(V value, int index) update) => {
      for (var (index, MapEntry(:key, :value)) in entries.indexed)
        key: update(value, index)
    };