It likely depends on which JavaScript engine, the engine version and your specific application.
Check out this recent comment from another article:
I guess the Mozilla developers heard you. Just did a little js-perf fiddle to retest and now forEach is roughly 20% faster than a traditional for loop (including length caching). :D — Johannes Rebhan
Unless you have identified this piece of your code as a bottleneck, it is not recommended to micro-optimize. Especially since your “optimizations” might be unoptimized with future JavaScript engine updates.
This is a great video by Mattias Petter Johansson that explains why this is not important.
You could also use a library that has optimized for performance so you do not have to. I would recommend lazy.js, it’s a great lib.
Cheers!
