4 ms·
It's a good point. When I started doing JS full-time, I wanted to squeeze out ever ms, writing for loops over using $.each or _.each, for example. But in the en
by mattwad 12y ago
It's a good point. When I started doing JS full-time, I wanted to squeeze out ever ms, writing for loops over using $.each or _.each, for example. But in the end, it just adds more lines of code and makes code harder to read. Also, the fact that each browser has significantly different results means you may need to implement different methods for each. There are times to maximize performance, but 95% of the time, you don't need the small boost. You're better off writing legible/maintainable code and using more high-level optimizations, like deferring heavy processes in a timeout.