sum all in array code example
Example 1: sum all elements in array javascript
arr.reduce((a, b) => a + b)
Example 2: sum all the values in an array javascript
array.reduce((a, b) => a + b, 0)
arr.reduce((a, b) => a + b)
array.reduce((a, b) => a + b, 0)