I know I’m expending way too much effort this, but I can’t think of a simpler method right now.

I’d like to use something like a spread operator to obtain the numbers in between the first and last digits…is that at all possible?

Or is something like a range method possible. (I know something like that exists in lodash but for vanilla JS?)

Thanks, as always.

Nick

**Tell us what’s happening:**

Describe your issue in detail here.

```
**Your code so far**
```

```
function sumAll(arr) {
let sum = [];
let begin = parseInt(arr[0]);
let end = parseInt(arr[1]);
if(begin > end){
begin = parseInt(arr[1])
end = parseInt(arr[0])
}
for(let i = begin; i <= end; i++){
sum.push(i);
}
let result = sum.reduce((a,b)=>{return a+b})
console.log(result)
return result;
}
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/96.0.4664.110 Safari/537.36`

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

**Link to the challenge:**