• Sum all numbers in an array. Optionally provide a function to convert objects in the array to number values.

    Type Parameters

    • T extends number

    Parameters

    • array: readonly T[]

    Returns number

  • Type Parameters

    • T extends object

    Parameters

    • array: readonly T[]
    • fn: ((item) => number)
        • (item): number
        • Parameters

          • item: T

          Returns number

    Returns number