Hi, i wanted to ask about the solution.
function rangeOfNumbers(startNum, endNum) {
if (endNum < startNum) {
return [];
} else {
const numbers = rangeOfNumbers(startNum, endNum - 1);
numbers.push(endNum);
return numbers;
}
}
In order to push endNum into the numbers array you need to create that array right? But you didn’t. You created a numbers variable, this is what I don’t understand, maybe I don’t get the topic , would you please explain this in some way?