函数1:varfoo=1;functionfnz(){console.log(foo);//undefinedfoo=3;varfoo=2;console.log(foo);//2};fnz();console.log(foo);//1函数2:varfoo=1;(function(foo){console.log(foo);//1foo=3;varfoo=2;console.log(foo);//2})(foo);console.log(foo);//1
拉莫斯之舞
相关分类