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
4 months ago
Test name Executions per second
Simple for loop - Access index and value 142464.1 Ops/sec
Array.forEach - Access index and value 96111.9 Ops/sec
for-of + Array.entries 63424.0 Ops/sec
for-of - Access value only 107774.0 Ops/sec
Simple for loop - Access value only 147837.8 Ops/sec
Array.forEach - Access value only 94079.0 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


;