7 ms·
I 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 tes
by michaelw 14y ago
I 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.