I’m trying to understand recursion. I came up with a function that calculates the sum of numbers in a range. In this case it’s numbers from 3 to 10.

```
var limit = 10;
function sumRange(value){
if(value===limit){
return value;
}
return value+sumRange(value+1);
}
sumRange(3);
```

Written like this the function seems to work fine with the limit being declared before the function.

However, when I refactor the code to look like this

```
function sumRange(value,limit){
if(value===limit){
return value;
}
return value+sumRange(value+1);
}
sumRange(3,10);
```

I get a ‘**Maximum call stack size exceeded**’ error. Can you help me understand why? Many thanks!