Function sum

  • Sums initial and the items of an iterable and returns the total.

    Returns

    The total sum of initial and iterable elements.

    Example

    sum([1, 2, 3, 4])
    // 10

    sum([1, 2, 3, 4], 5)
    // 15

    Parameters

    • args: number[]

      The elements to add to initial.

    Returns number

  • Type Parameters

    • T

    Parameters

    • args: Iterable<T>
    • Optional key: Predicate<T, any>

    Returns number

Generated using TypeDoc