My Solution
function sumAll(arr) {
let sum = 0;
let sortedArray = [];
sortedArray = arr.sort(function(a,b) {
return a > b;
});
for(i=sortedArray[0];i<=sortedArray[1];i++)
{
console.log(sum);
sum += i;
}
console.log(sum);
return sum;
}
sumAll([-9, -15]);
Won’t register as correct, even though it produces same results as the answers in “Hints”. Can anyone tell me why?