javascript的匿名函数写法和应用
javascript 的匿名函数常见形式or格式:
(function(参数名){//do something})(参数值);//eg:(function(a){alert("显示:"+a);//显示:我的})('我的');//相当于给参数a传一个值:'我的'//eg2: 不带参数的匿名函数(function () { alert("---running...");})();//声明一个函数: xxxxfunction xxxx(参数名){//do something}//调用该函数xxxx(参数值);(function(b){ alert(b);//显示: hello return function(c){ alert(c);//显示: world };})('hello')('world');(function(a){ alert(a);//不断的弹出显示 a接着显示b接着显示c.... return arguments.callee;})('a')('b')('c')('d')('e')('f');//事实上后面可以无限连续调用下去