Tell us what’s happening:
I would like to know what’s wrong with my code
Your code so far
function rangeOfNumbers(startNum, endNum) {
if (endNum < startNum){return []}
const arr = rangeOfNumbers(starNum, endNum-1)
arr.push(endNum)
return arr
};
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.5.2 Safari/605.1.15
Challenge: Basic JavaScript - Use Recursion to Create a Range of Numbers
Link to the challenge: