Array.prototype.reduce.call() vs Array.prototype.forEach.call() vs Conventional for loopFastest: Array.prototype.reduce.call() (4.7x faster)
134,074 ops/sec
123,413 ops/sec
28,386 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| Array.prototype.reduce.call() | |
| Array.prototype.forEach.call() | |
| Conventional for loop |
| Test name | Executions per second |
|---|---|
| ✓ Array.prototype.reduce.call() | 410,622 Ops/sec |
| Conventional for loop | 350,663 Ops/sec |
| Array.prototype.forEach.call() | 0 Ops/sec |