freecodecamp intermediate algorithm scripting sum all numbers in a range
function sumAll(arr) {
var total = 0
if(arr[0] < arr[1){
for(var i = arr[0]; i <= arr[1]; i++){
total += i
}
}else{
for(var i = arr[1] ; i <=arr[0] ; i++){
total += i
}
}
return total
}