Options
All
  • Public
  • Public/Protected
  • All
Menu

Module app/_helpers/array-sum

Index

Functions

Functions

arraySum

  • arraySum(arr: number[]): number
  • Returns the sum of all values in an array.

    example

    Prints 6 for the array [1, 2, 3]:

    console.log(arraySum([1, 2, 3]));
    

    Parameters

    • arr: number[]

      An array of numbers.

    Returns number

    The sum of all values in the array.

Generated using TypeDoc