© 2026 LinearBytes Inc.
Search posts, tags, users, and pages
Joel Jensen
Loves all things tech
Although, browser may optimise both the loops, I think the good old for loop is better in terms of performance. Check this article where you can see that the normal for loop was about 40 times faster than the forEach loop for a simple test.
for
forEach