**Tell us what’s happening:**

why is it logging 0 for everything i try ,even if i use push into an empty array its returning

**Your code so far**

```
function sumAll(arr) {
let temp=0;
let max = Math.max(arr[0],arr[1])
let min= Math.min(arr[0],arr[1]);
for(var i=max;i<=min;i--){
temp += i
}
return temp
}
console.log(sumAll([1, 4]));
```

**Your browser information:**

User Agent is: `Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36`

.

**Challenge:** Sum All Numbers in a Range

**Link to the challenge:**