const arr = [1,2,3,4,5]; function addAll(arr){ let result=0; for (i = 0; i<arr.length; i++){ result += arr[i] } return result; } addAll(arr);