News for hackers. Stuff that matters.
Re:Arguments Object: Doctor Jekyll and Mister Hyde in Node.js by noonat on Saturday July 16, 2011 @01:36PM (#2771183)
Here's a jsperf that tests just the arguments copy via slice, while loop, or for loop: http://jsperf.com/args-copy

In the browsers I tested in, it does indeed seem to be significantly faster to copy the array via a normal loop (in Chrome, Firefox, and WebKit mobile, at least). That said, don't start optimizing everything into for loops unless you've identified the code as a bottleneck. It's not worth the additional complexity for a function that's rarely called.

There are no comments on this comment yet.