find() vs for...of vs for-loop
Testing the difference between native loops and find()
one year ago
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.64 Safari/537.36
Test name |
Executions per second |
for-loop |
222028600.0 Ops/sec |
for..of |
239094400.0 Ops/sec |
Array.find() |
185913300.0 Ops/sec |
Tests:
-
for-loop
-
for..of
-
Array.find()
Open this result on MeasureThat.net