Function sum

Sum an array of numbers.

Addends to sum.

Property or mapping function of addends to sum

Sum of numbers

  • Sum an array of numbers.

    Type Parameters

    • S extends string | number | symbol
    • T extends {
          [s in string | number | symbol]: number
      }

    Parameters

    • addends: readonly T[]

      Addends to sum.

    • property: S

      Property of the elements to be summing

    Returns number

    Sum of numbers

  • Sum an array of numbers.

    Type Parameters

    • T

    Parameters

    • addends: readonly T[]

      Addends to sum.

    • mappingFunction: ((element: T) => number)

      Mapping function to turn addends into actual numbers.

        • (element): number
        • Parameters

          • element: T

          Returns number

    Returns number

    Sum of numbers