Run details:
Mozilla/5.0 (X11; Linux x86_64; rv:123.0) Gecko/20100101 Firefox/123.0
Firefox 123
Linux
Desktop
8 months ago
Test name Executions per second
.map 7159.4 Ops/sec
iterator loop 5866.0 Ops/sec
indexed loop (assign) 13732.3 Ops/sec
.forEach (assign) 6057.1 Ops/sec
indexed loop (push) 12709.3 Ops/sec
.forEach (push) 5535.6 Ops/sec
Script Preparation code:
Tests:
  • .map

  • iterator loop

  • indexed loop (assign)

  • .forEach (assign)

  • indexed loop (push)

  • .forEach (push)