Tests:
  • for

    AخA
     
    const arr = Array(10000).fill(0);
    const l = arr.length;
    for (let i = 0; i < l; i++) {
      arr[i];
    }
  • for of

     
    const arr = Array(10000).fill(0);
    for (let x of arr) {
      x;
    }
  • for in

     
    const arr = Array(10000).fill(0);
    for (let i in arr) {
      arr[i];
    }
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    for
    for of
    for in

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 2 years ago)
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.136 Safari/537.36
Chrome 102 on Linux
View result in a separate tab
Test name Executions per second
for 69507.0 Ops/sec
for of 59764.8 Ops/sec
for in 4721.5 Ops/sec