sumSimple
sumSimple(
x):number
Defined in: src/sum_simple.js:12
The simple sum of an array is the result of adding all numbers together, starting from zero.
This runs in O(n), linear time, with respect to the length of the array.
Parameters
Section titled “Parameters”number[]
input
Returns
Section titled “Returns”number
sum of all input numbers
Example
Section titled “Example”sumSimple([1, 2, 3]); // => 6