Tell us what’s happening:
Hey y’all I know this is incorrect but I am not sure why its not working. I tried to mimic the previous lesson and wanted to know how to make it work. I know there are easier ways but I wanted it do it this way. I am open for it to just be straight up wrong but I am looking more for an explanation why it does or does not work this way. Thanks!
Your code so far
function rangeOfNumbers(startNum, endNum) {
if (startNum <= endNum) {
return [];
} else {
const array = countup(endNum - 1 === startNum);
array.unshift(endNum);
return array;
}
}
rangeOfNumbers(5,10);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36
.
Challenge: Use Recursion to Create a Range of Numbers
Link to the challenge: