Value gives me not defined!

Tell us what’s happening:
why arr is not defined ?

Your code so far


function rangeOfNumbers(startNum, endNum) {
if (startNum <= endNum) {
  var arr = rangeofNumbers(startNum + 1, endNum);
  arr.unshift(startNum);
  return [arr];
}

};

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0.

Challenge: Use Recursion to Create a Range of Numbers

Link to the challenge:

you are using two different function names


also:

if this is false, your function returns undefined
meaning the function rangeOfNumbers(endNum, endNum) will returns undefined, and not a value usable in the snippet below: