Script Preparation code:
AخA
 
var as = [];
for (var i = 0; i < 10000; i++) {
  as.push(Math.floor(Math.random() * 1000));
}
Tests:
  • Array.entries

     
    const res = [];
    for(const a of as.entries()) res.push(a);
  • Array for i

     
    const res = [];
    for(let i = 0; i < as.length; i++) {
      const a = as[i];
      res.push(a);
    }
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Array.entries
    Array for i

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one year ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36
Chrome 116 on Mac OS X 10.15.7
View result in a separate tab
Test name Executions per second
Array.entries 22995.7 Ops/sec
Array for i 1489.7 Ops/sec