**Tell us what’s happening:**

I am getting the correct return value for each test but FCC isn’t accepting it

Im not sure if it’s because my code is so messy or what.

**Your code so far**

```
function sumAll(arr) {
var max = arr.reduce(function(a, b) {
return Math.max(a, b);
});
var min = arr.reduce(function(a, b) {
return Math.min(a, b);
});
var result;
for (var i = min; i <= max; i++) {
newArr.push([i]);
}
var flat = newArr.reduce(function (a, b) {
return a.concat(b);
});
var sum = flat.reduce(function (a, b) {
return a + b;
}, 0);
return sum;
}
sumAll([5, 10]);
```

**Your browser information:**

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

.

**Link to the challenge:**