forEach vs for len vs for in vs for of loops (version: 0)
created based off of an archived jsperf benchmark: http://web.archive.org/web/20191008221700/https://jsperf.com/foreach-vs-for-loop-vs-for-in-vs-for-of-vs-babel-for-of
Comparing performance of: forEach vs for optimized
Memory measurements supported only in Chrome.
For precise memory measurements Chrome must be launched with --enable-precise-memory-info flag.
More information: Monitoring JavaScript Memory
Test case name
Result
forEach
for optimized
Fastest:N/A
Slowest:N/A
Latest run results:
Run details: (Test run date:
one year ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36