Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:123.0) Gecko/20100101 Firefox/123.0
Firefox 123
Windows
Desktop
8 months ago
Test name Executions per second
.map 14025.2 Ops/sec
iterator loop 10392.9 Ops/sec
indexed loop (assign) 20044.3 Ops/sec
.forEach (assign) 9391.6 Ops/sec
indexed loop (push) 18308.3 Ops/sec
.forEach (push) 9912.4 Ops/sec
Script Preparation code:
Tests:
  • .map

  • iterator loop

  • indexed loop (assign)

  • .forEach (assign)

  • indexed loop (push)

  • .forEach (push)