自动执行函数的不同写法 var func1 = (function(){ var a = 1; alert( a );})();//弹窗输出 1等价于(function func2(){ var a = 2; alert( a );})(); //弹窗输出 2