.forEach vs for..of vs for..of (destructuring) vs .map vs .map (destructuring) vs .for (init array) vs .reduce vs .reduce (destructuring) vs for..of (reduce) vs for..of (reduce) (destructuring)| Test case name | Result |
|---|---|
| .forEach | |
| for..of | |
| for..of (destructuring) | |
| .map | |
| .map (destructuring) | |
| .for (init array) | |
| .reduce | |
| .reduce (destructuring) | |
| for..of (reduce) | |
| for..of (reduce) (destructuring) |
| Test name | Executions per second |
|---|---|
| ✓ for..of (reduce) (destructuring) | 63,874,252 Ops/sec |
| for..of (reduce) | 63,571,516 Ops/sec |
| for..of (destructuring) | 63,171,200 Ops/sec |
| for..of | 62,540,452 Ops/sec |
| .for (init array) | 56,116,088 Ops/sec |
| .reduce (destructuring) | 54,160,524 Ops/sec |
| .reduce | 49,730,352 Ops/sec |
| .forEach | 41,316,172 Ops/sec |
| .map | 36,072,416 Ops/sec |
| .map (destructuring) | 35,287,688 Ops/sec |