Tell us what’s happening:
it works on single digit but not on double digits
Please what do u think ?
**Your code so far**
function sumAll(arr) {
let z = 0
arr.sort()
for (let i = arr[0] ; i<=arr[1]; i++ ) {
z += i
}
return z
}
it works on single digit but not on double digits :(
Please what do u think ?
console.log(sumAll([5,10]))
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36
Challenge: Intermediate Algorithm Scripting - Sum All Numbers in a Range
Link to the challenge: