**Tell us what’s happening:**

can someone help me see where I’m going wrong here? I think my logic is correct I just think I may have a minor bug within my implementation.

Thank you!

**Your code so far**

```
function sumAll(arr) {
//set sum = 0
let sum = 0
// find min and max
sum += Math.max(arr);
sum += Math.min(arr)
console.log(sum)
//set var = math.min
let middle = (Math.min(arr) + 1)
// while var < math.max
// add var to sum
while (middle < Math.max(arr)) {
sum += middle
}
return sum
}
console.log(sumAll([1, 4]));
```

**Your browser information:**

User Agent is: `Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36`

.

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

**Link to the challenge:**