Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:105.0) Gecko/20100101 Firefox/105.0
Firefox 105
Windows
Desktop
2 years ago
Test name Executions per second
For i++ (const size) 201063.5 Ops/sec
For i++ (.length) 198844.5 Ops/sec
For ... in 718.1 Ops/sec
for ... of 12364.1 Ops/sec
indexOf 236898.1 Ops/sec
findIndex 32259.1 Ops/sec
Includes 236380.7 Ops/sec
Some ? 33754.7 Ops/sec
forEach 23068.8 Ops/sec
Script Preparation code:
Tests:
  • For i++ (const size)

  • For i++ (.length)

  • For ... in

  • for ... of

  • indexOf

  • findIndex

  • Includes

  • Some ?

  • forEach