<div class="codetitle"> <span><a style="CURSOR: pointer" data="56528" class="copybut" id="copybut56528" onclick="doCopy('code56528')"><u>复제대码</u></a></span> 代码如下:</div> <div class="codebody" id="code56528"> <br> Array.prototype.each = function(fn) <br>{ <br>return this.length ? [fn(this.slice(0,1))].concat(this.slice(1).each(fn)) : []; <br>}; <br><br>[1,2,3,4].each(function(x){ <br>document.write(x "<br/>"); <br>}); <br> </div>