Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
findIndex vs indexOf vs includes- JavaScript perf
(version: 1)
Comparing performance of:
findIndex vs indexOf vs includes
Created:
9 months ago
by:
Guest
Jump to the latest result
Script Preparation code:
var arr = new Array(15000); arr.fill({ id: 0 }); arr = arr.map((el, idx) => el.id = idx); var foo = Math.floor(Math.random() * 15000);
Tests:
findIndex
var index = arr.findIndex((num) => num === foo);
indexOf
var index = arr.indexOf(foo);
includes
var index = arr.includes(foo);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
findIndex
indexOf
includes
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
9 months ago
)
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:140.0) Gecko/20100101 Firefox/140.0
Browser/OS:
Firefox 140 on Linux
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
findIndex
3984.1 Ops/sec
indexOf
24866.0 Ops/sec
includes
25474.6 Ops/sec
Related benchmarks:
findIndex vs indexOf
basic comparison - findIndex vs indexOf
findIndex vs indexOf - JavaScript performance
findIndex vs. indexOf
findIndex vs indexOf vs includes - JavaScript performance
findIndex vs IndexOf + map
findIndex vs find - JS Perf
findIndex vs indexOf - JavaScript performance [clone]
findIndex vs indexOf - JavaScript perf test
Comments
Confirm delete:
Do you really want to delete benchmark?