DEV Community

loading...

Discussion on: Possible ways of Iterating ARRAYS in JavaScript

Collapse
aashrithashiva29 profile image
Aashritha Shiva Author • Edited
  • I haven't checked the example issue... I have corrected it. Thanks for this :)
  • yeah, I have come to the conclusion after performing the test with performance.now(). But it was wrong. Yes "for loop is the fastest"
  • and caching length inside the loop is fine!!
  • jsPerf was great And to correct "for..of" is faster compared to for..in and forEach but indeed for is the fastest one over all others. Thanks for listing out these points.