Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:100.0) Gecko/20100101 Firefox/100.0
Firefox 100
Mac OS X 10.15
Desktop
2 years ago
Test name Executions per second
For i++ (const size) 188502.2 Ops/sec
For i++ (.length) 187807.1 Ops/sec
For ... in 1167.6 Ops/sec
for ... of 20318.0 Ops/sec
indexOf 287136.2 Ops/sec
findIndex 38818.9 Ops/sec
Includes 285365.0 Ops/sec
Some ? 37257.4 Ops/sec
Script Preparation code:
Tests:
  • For i++ (const size)

  • For i++ (.length)

  • For ... in

  • for ... of

  • indexOf

  • findIndex

  • Includes

  • Some ?

  • forEach