The exercise "Use Recursion to Create a Range of Numbers" does not

Tell us what’s happening:
Describe your issue in detail here.

The code work in Visual Studio, but in the freeCodecamp platform does not.
Thanks in advance.

**Your code so far**

function rangeOfNumbers(startNum, endNum) {
if(startNum > endNum)
    return [];
const regressao = range(startNum +1 , endNum);
return regressao;
**Your browser information:**

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36

Challenge: Use Recursion to Create a Range of Numbers

Link to the challenge:

When I add

console.log(rangeOfNumbers(1, 5));

to your code, I get output

ReferenceError: range is not defined

which means the problem is here

As written, your function is not recursive since it does not call itself.

1 Like

Thank you very much!! That’s right, I was coding in visual studio for debugging and forgot to change the function name.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.