function sumAll(arr) {

var newArr = [];

var big = Math.max(arr[0],arr[1]);

var small = Math.min(arr[0],arr[1]);

for (var i = small; i<arr.length;i++){

if(i < big){

arr.push(i);

}

}

for (var j = big; i<arr.length;i++){

if(j > small){

arr.push(j);

}

}

for (var n = small; n<arr.length; n++){

if(n !== arr[i]) {

newArr.push(n);

}

}

return newArr.reduce(function(a, b){

return a+b;

}

);

}

sumAll([1, 4]);

So, with this function, I am getting what I am supposed to with 1, 4.

and 4, 1. When I try to plug in 5, 10, and 10, 5, though, it doesnt

even run the for loop.

In other words I don’t think it’s running the for loop unless “small” is one. If it is bigger it won’t seem to compute!