Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:136.0) Gecko/20100101 Firefox/136.0
Firefox 136
Windows
Desktop
3 days ago
Test name Executions per second
for-of 144.7 Ops/sec
for-index 756.7 Ops/sec
Script Preparation code:
AخA
 
const planes = new Array(1_000_000).fill(2);
Tests:
  • for-of

     
    for (const plane of planes) {
        Math.sqrt(plane);
    }
  • for-index

    x
     
    for (let i = 0; i < planes.length; i++) {
        const plane = planes[i];
        Math.sqrt(plane);
    }