suma wszystkich liczb w tablicy JavaScript
const arrSum = arr => arr.reduce((a,b) => a + b, 0)
TechWhizKid
const arrSum = arr => arr.reduce((a,b) => a + b, 0)
function array(arr){
var sum = 0;
for (var i = 0; i< arr.length; i++){
sum += arr[i];
}
console.log(sum);
}
array([5, 1, 3, 3])