Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:103.0) Gecko/20100101 Firefox/103.0
Firefox 103
Windows
Desktop
one year ago
Test name Executions per second
For i++ (const size) 203525.0 Ops/sec
For i++ (.length) 182275.0 Ops/sec
For ... in 791.3 Ops/sec
for ... of 14737.4 Ops/sec
indexOf 231952.8 Ops/sec
findIndex 33749.8 Ops/sec
Includes 244246.3 Ops/sec
Some ? 33286.7 Ops/sec
forEach 22027.2 Ops/sec
set has 1769829000.0 Ops/sec
Script Preparation code:
Tests:
  • For i++ (const size)

  • For i++ (.length)

  • For ... in

  • for ... of

  • indexOf

  • findIndex

  • Includes

  • Some ?

  • forEach

  • set has