variables in nested functions "undefined"
<pre><code>windows.onload=function(){
    ...somecode...
    var scene = new THREE.Scene();
    ...somecode...
    var i;
    var j;
    for (i=......){...}
    func2();
    function func2(){
        ...somecode...
        BREAK AT THIS LINE;
    }
}
</code></pre>

<p>when I break at that line,<br>
firebug says, "i" and "j" is undefined,but an inner function obviously can get the value of "i" right?<br>
but weirdly, "scene" is showed correctly.<br>
the Ctrl+Shift+I of chrome shows the same thing.  </p>

<p>but the thing more weird is,
when I add  </p>

<pre><code>alert(i);
</code></pre>

<p>to the beginning of func2,<br>
this time,
the msgBox tells the value of i correctly,<br>
firebug shows the value of i correctly,<br>
but j is still showed undefined.  </p>

<p>I'm wondering why,<br>
Both Firebug and chrome shows the same thing so it seems not a bug of Firebug,<br>
so is there any hints for this?</p>

<p>thanks a lot.</p>
