for vs for of vs find vs for each MEGA!!

Testing the difference between native loops and find()
2 months ago
User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.128 Safari/537.36
Test name Executions per second
for 110050.6 Ops/sec
for of 207122.0 Ops/sec
find 303837.0 Ops/sec
for each 196647.8 Ops/sec
HTML Preparation code:
  • for

  • for of

  • find

  • for each

Open this result on