3 ms·
Can I ask for your help with testing some js loop syntax?
- arash_milani 14y agoThere are various articles on the web that you can improve your javascript loop performance by modifying the way you code them. I wanted to know what is the current state for these techniques due to improvements in browser engines. Thank you for your time.
- michaelw 14y agoI gave this a try and added the functional form (i.e. bigArray.forEach). I was a little surprised at how much slower this was. I ended up creating another test where every case had a function call overhead. All three functional forms (forEach, map and reduce) were slower than the plain old loop http://jsperf.com/am-js-loops/7/edit http://jsperf.com/am-js-loops/7/edit
- arash_milani 14y agoThank you for contribution and addition of that functional form. yeah they are much more slower that plain old for loops.