Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:131.0) Gecko/20100101 Firefox/131.0
Firefox 131
Windows
Desktop
5 months ago
Test name Executions per second
for 3575.7 Ops/sec
fill and map 8796.1 Ops/sec
Script Preparation code:
AخA
 
var iterations = 10000;
Tests:
  • for

     
    res = []
    for (i = 0; i < iterations; i++) {
      res.push(i);
    }
  • fill and map

     
    res = Array(iterations).fill(null).map((value, index) => index);