function sum(arr) { let result = 0; for(var i =0;i<arr.length;i++){ result+=arr[i]; } return result; }