function sumAll(arr) {
  var total = 0;
  var len = arr.length;
  
  for(var i = 0; i <= len;i++){
    total += arr[i];
  }
  return total;
}

sumAll([1, 4]);

@@ -37,34 +37,259 @@
  0;%0A
+%0A
   
-var len = arr.length
+%0A  createRange(arr).forEach(function(val)%7B%0A    total += val;%0A  %7D);%0A  %0A  return total;%0A  %0A%7D%0A%0Afunction createRange(arr) %7B%0A  var end = arr%5B1%5D;%0A  var start = arr%5B0%5D;%0A  var range = %5B%5D;%0A%0A  if (arr%5B0%5D %3E arr%5B1%5D) %7B%0A    start = arr%5B1%5D;%0A    end = arr%5B0%5D
 ;%0A  
+%7D%0A
 %0A  f
@@ -303,20 +303,25 @@
 i = 
-0
+start
 ; i %3C= 
-l
 en
-;
+d; 
 i++)
@@ -330,48 +330,59 @@
     
-total += arr%5Bi%5D;%0A  %7D%0A  return total;%0A%7D%0A%0A
+range.push(i);%0A  %7D%0A  return range;%0A%7D%0A%0A%0Aconsole.log(
 sumA
@@ -390,11 +390,13 @@
 l(%5B1
+0
 , 
-4%5D
+5%5D)
 );%0A

Add sollution to sum all