Run details:
Mozilla/5.0 (X11; Linux x86_64; rv:138.0) Gecko/20100101 Firefox/138.0
Firefox 138
Linux
Desktop
one year ago
Test name Executions per second
for loop 125857.8 Ops/sec
for of with reverse 7148.9 Ops/sec
for of with toReversed 10398.8 Ops/sec
reduceRight 16015.4 Ops/sec
reduceRight with add operation 14299.3 Ops/sec
forEach with reverse 6738.0 Ops/sec
forEach with toReversed 9918.0 Ops/sec
Script Preparation code:
Tests:
  • for loop

  • for of with reverse

  • for of with toReversed

  • reduceRight

  • reduceRight with add operation

  • forEach with reverse

  • forEach with toReversed