Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:128.0) Gecko/20100101 Firefox/128.0
Firefox 128
Mac OS X 10.15
Desktop
3 months ago
Test name Executions per second
Simple for loop - Access index and value 1452753.1 Ops/sec
Array.forEach - Access index and value 328167.0 Ops/sec
for-of + Array.entries 183621.7 Ops/sec
for-of - Access value only 452096.5 Ops/sec
Simple for loop - Access value only 1551035.5 Ops/sec
Array.forEach - Access value only 348859.4 Ops/sec
Script Preparation code:
Tests:
  • Simple for loop - Access index and value

  • Array.forEach - Access index and value

  • for-of + Array.entries

  • for-of - Access value only

  • Simple for loop - Access value only

  • Array.forEach - Access value only


;