Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I just use Array.prototype.[forEach|map|filter] instead, or the equivalent Underscore.js function (which aliases to native when it can) if IE-compatibility is needed.

If you need performances, nothing will beat C-style access anyway. And FWIW, using for...in on an array is slower than using Array.prototype.forEach.

edit: FWIW, even hand-rolling an each() function (in the style of underscore's) will be faster than for...in.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: