Function sum

  • Namespace

    ArrayUtils

    Returns the combined sum of all numbers in an array.

    Parameters

    • numbers: number[]

      An array of numbers

    Returns number

    The sum of all values in an array.

    Example

    const numbers = [1, 2, 3, 4];
    const arraySum = sumArray(numbers);
    console.log(arraySum); // Output: 10

Generated using TypeDoc