# Why maximum call stack size exceeded

Tell us what’s happening:
Question: Basic JavaScript: Use Recursion to Create a Range of Numbers.
We have defined a function named `rangeOfNumbers` with two parameters. The function should return an array of integers which begins with a number represented by the `startNum` parameter and ends with a number represented by the `endNum` parameter. The starting number will always be less than or equal to the ending number. Your function must use recursion by calling itself and not use loops of any kind. It should also work for cases where both `startNum` and `endNum` are the same.

``````function rangeOfNumbers(startNum, endNum) {
if (endNum - startNum === 0) {
return [startNum];
} else {
var numbers = rangeOfNumbers(startNum, endNum - 1);
numbers.push(endNum);
return numbers;
}
}
``````

``````
function rangeOfNumbers(startNum, endNum) {
if(endNum - startNum === 0) {
return [startNum];
}
else {
var numbers = rangeOfNumbers(startNum++, endNum);
numbers.push(startNum);
return numbers;
}
};
console.log(rangeOfNumbers(3,6));

``````

don’t understand why using startNumber++ causes endless loop.

User Agent is: `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36`.
If you post a full passing solution to a challenge and have questions about it, please surround it with `[spoiler]` and `[/spoiler]` tags on the line above and below your solution code.