javascript変数の履歴
曖昧にしてたけどがっつり理解した!
<script type="text/javascript"> var i = "iii"; var j = "jjj"; k = "kkk"; l = "lll"; function f2(){ alert("f2 is i="+i+" ,j= "+j+"k="+k+" ,l= "+l);// iii , jjj2, kkk2, lll } function f1(){ alert("f1 is i="+i+" ,j= "+j+"k="+k+" ,l= "+l);// undefined , jjj , kkk , undefined var i = "iii2"; j = "jjj2"; k = "kkk2"; var l = "lll2"; alert("f1 is i="+i+" ,j= "+j+"k="+k+" ,l= "+l);// iii2 , jjj2, kkk2, lll2 f2(); } f1(); </script>