Compare indexOf vs find vs findIndex.
const arr = Array.from({length: 10000}, (_, i) => ({ id: i, value: 'val' + i }));
const target = 5000;Initializing...
| Test Case | Ops/sec | |
|---|---|---|
| findIndex | | ready |
| find | | ready |
| for loop | | ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.