title: Unexplained undefined value on return
body: <p>I've got an issue with an undefined value in below code that neither me nor any of my collegues can explain: </p>
  
  <pre><code>function reverseFactorial(num) {
    function reverse(altNum, fac){
    console.log(altNum + ', ' + fac);
      if ((altNum / fac) === 1)
              {  
              console.log(fac.toString() + '!');
         return fac.toString() + '!'; 
              }
  
         else {
         reverse(altNum / fac, fac + 1);
         }
    }
    var ret = reverse(num, 1);
    console.log(ret);
    return ret;
  }
  </code></pre>
  
  <p>An example input could be: <code>reverseFactorial(120)</code>.</p>
  
  <p>The logs would then show this:</p>
  
  <blockquote>
    <p>120, 1</p>
    
    <p>120, 2 </p>
    
    <p>60, 3 </p>
    
    <p>20, 4 </p>
    
    <p>5, 5 </p>
    
    <p>5! </p>
    
    <p>undefined</p>
  </blockquote>