Script Preparation code:
AخA
 
var arr = [1,2,3,4,5];
Tests:
  • forEach

     
    arr.forEach((item, index) => console.log(item + index))
  • array.entries

     
    for(var [index, item] in arr.entries()){ 
      console.log(item + index);
    }
  • for

     
    for( var index = 0; index < arr.length; index++ ){
      console.log(arr[index] + index);
    }
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    forEach
    array.entries
    for

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 5 months ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Chrome 131 on Mac OS X 10.15.7
View result in a separate tab
Test name Executions per second
forEach 14911.1 Ops/sec
array.entries 25973474.0 Ops/sec
for 17936.0 Ops/sec