Hacker News new | past | comments | ask | show | jobs | submit login

I think it's an oversight. The coding conventions I work with ban that form of a for-loop, precisely because the .length access can potentially be very costly. (I'm in a different part of the company, one that doesn't use Closure, but our latency constraints are even tighter than theirs are.) If you're iterating over a NodeList and not just an array, it can actually turn an O(N) loop into an O(N^2) one.



Interesting, thanks.




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

Search: