Function toObj

  • Converts an array to an object.

    Type Parameters

    • T
    • R = T

    Parameters

    • arr: T[]

      array to fill

    • keyFn: ((item) => PropertyKey)

      function to get the key from the item

        • (item): PropertyKey
        • Parameters

          • item: T

          Returns PropertyKey

    • valueFn: ((item) => R) = ...

      function to get the value from the item

        • (item): R
        • Parameters

          • item: T

          Returns R

    Returns Record<PropertyKey, R>

    an object with the keys and values from the array

Generated using TypeDoc