Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.136 Safari/537.36
Chrome 102
Linux
Desktop
2 years ago
Test name Executions per second
for 69507.0 Ops/sec
for of 59764.8 Ops/sec
for in 4721.5 Ops/sec
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];
    }