Arc Forumnew | comments | leaders | submitlogin
1 point by rocketnia 4850 days ago | link | parent

Actually, you're right. ^^; In JavaScript, all variables declared in a function are visible throughout the function, even before the declaration statement.

  var foo = 4;
  
  (function(){
    alert( foo );  // "undefined"
    var foo = 2;
  })();
My mistake. ^_^;