how to sum up all numbers in an array javascript code example Example: sum all elements in array javascript arr.reduce((a, b) => a + b)