Tell us what’s happening:
Describe your issue in detail here.
Can someone help me understand what mistake I am making in this code? When I change the “startNum = endNum” part to “endNum-startNum === 0” it works but isn’t it the same thing as in my code?
**Your code so far**
function rangeOfNumbers(startNum, endNum) {
if (startNum = endNum) {
return [startNum];
} else {
var array = rangeOfNumbers(startNum,endNum-1);
array.push(endNum);
return array;
}
};
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36
Challenge: Use Recursion to Create a Range of Numbers
Link to the challenge: