code:var bla; function a() { // Do something bla = "hello"; b(); } function b() { alert(bla); }
code:function a() { // Do something var bla = "hello"; b(); } function b() { alert(bla); }