Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
0f34ebcc-626d-4bc7-a899-c8b8f3db7d88
(version: 1)
Comparing performance of:
findIndex vs indexOf
Created:
one year ago
by:
Guest
Jump to the latest result
Script Preparation code:
var arr = new Array(50000); arr.fill({ id: 0 }); arr = arr.map((el, idx) => el.id = idx); var foo = Math.floor(Math.random() * 50000);
Tests:
findIndex
var index = arr.findIndex((num) => num === foo);
indexOf
var index = arr.indexOf(foo);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
findIndex
indexOf
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36
Browser/OS:
Chrome 133 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
findIndex
371780.1 Ops/sec
indexOf
1575076.8 Ops/sec
Related benchmarks:
findIndex vs indexOf
basic comparison - findIndex vs indexOf
findIndex vs. indexOf
findIndex & indexOf on 2000 strings
Comparing findIndex with map & indexOf
findIndex vs for loop test
Test Alex hoho
ELLHVRTqäU
Test Loop Set Data
Comments
Confirm delete:
Do you really want to delete benchmark?