**Tell us what’s happening:**

**Your code so far**

```
function sumAll(arr) {
if (arr[0]<arr[1]){
for (var element=arr[0]; element<=arr[1]; element++){
var sum = 0;
sum += element;
}
return (sum);
}else{
for (var element=arr[0]; element>=arr[1]; element--){
var sum = 0;
sum += element;
}
return (sum);
}
}
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/73.0.3683.75 Safari/537.36`

.

**Link to the challenge:**

https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/sum-all-numbers-in-a-range/