js 函数arguments一种用法

无意改同事的代码发现的

 1 function toggle(){
 2             var _arguments=arguments;
 3             var count=0;
 4             $("#more").click(function(){
 5                 _arguments[count++%_arguments.length]();
 6             })
 7         }
 8 
 9 toggle(function(){
10             obj.animate({"height":oHeight});
11             $("#more").empty().html("点击收起");
12             },function(){
13                 obj.animate({"height":eHeight+oPaddingTop});
14                 $("#more").empty().html("点击展开");
15             })

实际就是取余,arguments执行基数还是偶数的方法

原文地址:https://www.cnblogs.com/junwu/p/4975215.html