Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:97.0) Gecko/20100101 Firefox/97.0
Firefox 97
Mac OS X 10.15
Desktop
2 years ago
Test name Executions per second
for 26919546.0 Ops/sec
foreach 13691518.0 Ops/sec
for..of 1620745.9 Ops/sec
for with cached length 27349782.0 Ops/sec
for with pre-cached length 26291942.0 Ops/sec
Script Preparation code:
Tests:
  • for

  • foreach

  • for..of

  • for with cached length

  • for with pre-cached length