Undefined variables in JavaScript
<p>Here is a JavaScript example from <em>Eloquent JavaScript</em>:</p>

<pre><code>function findSequence(goal) {
  function find(start, history) {
    if (start == goal)
      return history;
    else if (start &gt; goal)
      return null;
    else
      return find(start + 5, "(" + history + " + 5)") ||
             find(start * 3, "(" + history + " * 3)");
  }
  return find(1, "1");
}
</code></pre>

<p>At the very beginning "start" and "goal" in line 3 are not defined. Why does the code not immediately return a result like "undefined" or "ReferenceError: ... is not defined"?</p>
