var test=1; var a=function go() { var test=2; }; alert(test); var b=function set() { window.test=3; }; alert(test);