Tell us what’s happening:
Describe your issue in detail here.
its not exactly a issue but i learned js in hs and its been two years since then, i decided to do this problem just off of memory, Just wanted to know am i close or do i go the right idea?
Your code so far
function sumAll(arr) {
let sum = arr[0] + arr[1];
let bsum = 0;
if ( arr[0] < arr[1]){
for(let i = arr[0]; i < arr[1]; i++){
bsum += i;
}
}
return sum + bsum;
}
sumAll([1, 4]);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36
Challenge Information:
Intermediate Algorithm Scripting - Sum All Numbers in a Range