for loop vs for of with reverse vs for of with toReversed vs reduceRight vs reduceRight with add operation vs forEach with reverse vs forEach with toReversed| Test case name | Result |
|---|---|
| for loop | |
| for of with reverse | |
| for of with toReversed | |
| reduceRight | |
| reduceRight with add operation | |
| forEach with reverse | |
| forEach with toReversed |
| Test name | Executions per second |
|---|---|
| ✓ for loop | 125,858 Ops/sec |
| reduceRight | 16,015 Ops/sec |
| reduceRight with add operation | 14,299 Ops/sec |
| for of with toReversed | 10,399 Ops/sec |
| forEach with toReversed | 9,918 Ops/sec |
| for of with reverse | 7,149 Ops/sec |
| forEach with reverse | 6,738 Ops/sec |