add all numbers in array javascript es6 code example
Example: how to add all values of array together js
function addArrayNums(arr) {
let total = 0;
for (let i in arr) {
total += arr[i];
}
return total;
}
function addArrayNums(arr) {
let total = 0;
for (let i in arr) {
total += arr[i];
}
return total;
}