reduce vs filter vs for...of vs forEachFastest: for-of (3.0x faster)
261,382 ops/sec
230,916 ops/sec
107,616 ops/sec
86,193 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| reduce | |
| filter | |
| for...of | |
| forEach |
| Test name | Executions per second |
|---|---|
| ✓ for...of | 262,434 Ops/sec |
| forEach | 232,595 Ops/sec |
| reduce | 206,993 Ops/sec |
| filter | 136,459 Ops/sec |