Paste Search Dynamic
Recent pastes
sumAll
  1. /*
  2.  your code goes here
  3.  */
  4. function sumAll(arr) {
  5.   let sum = 0
  6.   for (let i=0; i<arr.length; i++){
  7.         let max = arr[0]
  8.         if(arr[i] > max){
  9.                 return max = arr[i]
  10.         }
  11.   }
  12. }
  13.  
  14. console.log(sumAll([1, 4]))
Parsed in 0.001 seconds