Here’s my solution for this challenge:
function sumAll(arr) {
var myArray = arr;
maxValue = Math.max.apply(null, myArray);
minValue = Math.min.apply(null, myArray);
var newArray = Array();
newArray.push(minValue, maxValue);
var ourTotal = 0;
for (var i = minValue; i <= maxValue; i++){
ourTotal += newArray[0]++;
}
return ourTotal;
}
sumAll([1, 4]);