I’m a beginner and still don’t understand a lot about JavaScript but I feel like my code here should work.

I’m wondering why it just returns 0 for the sum.

My Solution:

```
function sumAll(arr) {
var sum = 0;
var min = Math.min(arr);
var max = Math.max(arr);
var i = min;
while (i <= max) {
sum += i;
i++;
}
return sum;
};
console.log(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/88.0.4324.190 Safari/537.36`

.

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

**Link to the challenge:**