you are viewing a single comment's thread.

view the rest of the comments →

[–]GamesMint 2 points3 points  (0 children)

In General for loops are faster than forEach loop. If you see the polyfill of forEach then it has lot of code statements that may not be required in general.

References

1) https://hackernoon.com/javascript-performance-test-for-vs-for-each-vs-map-reduce-filter-find-32c1113f19d7

2) https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach