Function sum

  • Compute the sum of an array of numbers.

    Parameters

    Returns number

  • Compute the sum of an array, using the given accessor to convert values to numbers.

    Type Parameters

    • T

    Parameters

    • iterable: Iterable<T>
    • accessor: ((datum, index, array) => number)
        • (datum, index, array): number
        • Parameters

          • datum: T
          • index: number
          • array: Iterable<T>

          Returns number

    Returns number