Tell us what’s happening:
Could anyone tell me what is wrong with my code?
I have traced my code via https://goo.gl/EwDLuR
The problem seems to occur on the for loop part.
Your code so far
function sumAll(arr) {
var max = Math.max(...arr);
var min = Math.min(...arr);
var result = 0;
for(; min <= max; min++ ){
result+= min;
}
return result;
}
sumAll([1, 4]);
Your browser information:
Your Browser User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36
.
Link to the challenge:
https://www.freecodecamp.org/challenges/sum-all-numbers-in-a-range