title: I'm getting undefined when returning the array from the function, although the array changed
body: <p>I have a function that's supposed to use recursion, and return an array of numbers from startNum to endNum, although I successfully got an array with the numbers I'm looking for the function is returning undefined.</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>let arr = []
  
  function rangeOfNumbers(startNum, endNum) {
    if(startNum == endNum){
        arr.push(startNum)
        return arr;
    } else {
        arr.push(startNum)
        startNum++;
        rangeOfNumbers(startNum, endNum);
    }
  };
  
  console.log(rangeOfNumbers(6, 9))
  console.log(arr)</code></pre>
  </div>
  </div>
  </p>