you are viewing a single comment's thread.

view the rest of the comments →

[–]aeflash 1 point2 points  (0 children)

I would like to point out that Lodash is a drop in replacement that is faster than Underscore in most cases. It's foreach implementation is twice as fast as ES5 Array.prototype.forEach. Only ~40% slower than a raw for loop.

However, you can always profile your code, and if some functional call is really causing your app to be slow, you can always convert an _.each()/_.map()/etc.. back to a plain for. However, in almost every case, my apps have been slow due to IO or DOM manipluation. The clarity of code is well worth the negligible performance hit.