title: Recursive power function: Why does this work if there's no initial return value?
body: <p>because power(base, exponent) has no return value unless exponent is 0, initially, shouldn't power(base, exponent -1) return 'undefined', and therefore be unmultipliable, initially?  So, I am having trouble following the logic of this code.  Why/how does it work?</p>
  
  <pre><code>function power(base, exponent) {
    if (exponent == 0)
      return 1;
    else
      return base * power(base, exponent - 1);
  }
  </code></pre>