Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:74.0) Gecko/20100101 Firefox/74.0
Firefox 74
Windows
Desktop
4 years ago
Test name Executions per second
for var 2022221.6 Ops/sec
for let 2030752.0 Ops/sec
for var cached length 3558726.8 Ops/sec
for let cached length 3662209.5 Ops/sec
forEach function 3153765.5 Ops/sec
forEach arrow 3161715.8 Ops/sec
some function 3164476.0 Ops/sec
some arrow 3049700.2 Ops/sec
for...of var 1373227.9 Ops/sec
for...of const 1298393.1 Ops/sec
Script Preparation code:
Tests:
  • for var

  • for let

  • for var cached length

  • for let cached length

  • forEach function

  • forEach arrow

  • some function

  • some arrow

  • for...of var

  • for...of const