Create a new Map by associating the value of mapper executed for each key in the source map.

  • Type Parameters

    • K
    • V
    • M

    Parameters

    • map: ReadonlyMap<K, V>

      source map

    • mapper: ((value: V, key: K) => M)

      function to compute a value in the resulting map for the source key and value

        • (value, key): M
        • Parameters

          • value: V
          • key: K

          Returns M

    Returns Map<K, M>