2010-06-07から1日間の記事一覧
・クロージャーなプログラムの例 var hoge=1111111;var test = function() { var piyo=hoge; ここがクロージャー↓ return function() { alert(piyo); } };var test1 = test(); hoge=22222222; test1(); var test1 = test();が実行された時点でpiyoの値は確定…
・クロージャーなプログラムの例 var hoge=1111111;var test = function() { var piyo=hoge; ここがクロージャー↓ return function() { alert(piyo); } };var test1 = test(); hoge=22222222; test1(); var test1 = test();が実行された時点でpiyoの値は確定…