Elastic find index fast

Measuring which is faster
9 months ago
User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/117.0
Test name Executions per second
Array.prototype.findIndex 3141.1 Ops/sec
For loop 11428.8 Ops/sec
While loop 8410.7 Ops/sec
Script Preparation code:
Tests:
  • Array.prototype.findIndex

  • For loop

  • While loop

Open this result on MeasureThat.net