findIndex vs for loopFastest: findIndex (2.6x faster)
1,316 ops/sec
501 ops/sec
Fastest: for loop (5.0x faster)
58,255 ops/sec
11,718 ops/sec
Fastest: findIndex (2.4x faster)
1,873 ops/sec
782 ops/sec
Fastest: findIndex (2.6x faster)
797 ops/sec
311 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| findIndex | |
| for loop |
| Test name | Executions per second |
|---|---|
| ✓ for loop | 12,111 Ops/sec |
| findIndex | 5,065 Ops/sec |