Why can anonymous functions defined with `var` be called in global scope?
<pre>
function setupSomeGlobals() {
  // Local variable that ends up within closure
  var num = 666;
  // Store some references to functions as global variables
  var gAlertNumber = function() { console.log(num); }
}

setupSomeGlobals();

gAlertNumber(); //works, WHY?!!

console.log(num); //does not work, GOOD
</pre>

<p>I expected gAlertNumber() to not work outside the setupSomeGlobals() function...</p>
