Please help solution to Basic Javascript 111 is not working

Tell us what’s happening:

  **Your code so far**

function rangeOfNumbers(startNum, endNum) {
if (startNum == endNum) {
  return [endNum];
} else {
  const arr = rangeOfNumbers(startNum + 0, endNum);
  arr.unshift(endNum);
  return arr;
}
};

  **Your browser information:**

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

Challenge: Use Recursion to Create a Range of Numbers

Link to the challenge:

Your problem is on this line. You’ve made an infinite recursion.

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