for vs .reduce vs .reduce (destructuring) vs for..of (reduce) vs for..of (reduce) (destructuring)Fastest: for..of (reduce) (2.8x faster)
170,421,568 ops/sec
161,457,120 ops/sec
158,846,496 ops/sec
115,342,624 ops/sec
60,184,472 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| for | |
| .reduce | |
| .reduce (destructuring) | |
| for..of (reduce) | |
| for..of (reduce) (destructuring) |
| Test name | Executions per second |
|---|---|
| ✓ for..of (reduce) (destructuring) | 211,501,376 Ops/sec |
| for..of (reduce) | 211,188,288 Ops/sec |
| for | 210,398,096 Ops/sec |
| .reduce | 197,806,256 Ops/sec |
| .reduce (destructuring) | 197,065,056 Ops/sec |