Can someonehelp me with this?

Tell us what’s happening:

Your code so far


function rangeOfNumbers(startNum, endNum) {
if (endNum - startNum === 0) {
  return [];
} else {
  var numbers = rangeofNumbers(startNum, endNum - 1);
  numbers.push(endNum);
  return numbers
}
return [];
};

Your browser information:

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

Challenge: Use Recursion to Create a Range of Numbers

Link to the challenge:

Tell us what’s happening. What exactly you are having problem with? What did you try already?

hey bro, you have done a couple of mistakes in your code …

1.  remove  return[]   at the end.
2.  var numbers = rangeofNumbers(startNum, endNum - 1); // change 'o' to 'O'
3.  if (endNum - startNum === 0) // change to if (endNum - startNum < 0)
  1.    2nd line should be if(endNum  - startNum < 0)
    
  2.    remove return [ ]

tell us what you are trying to achieve