Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
!!find vs findIndex != -1
(version: 0)
Measuring which is faster
Comparing performance of:
Array.prototype.find vs Array.prototype.findIndex
Created:
4 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
var arr = []; var i = 0; while (i <= 1E5) arr[i] = i++;
Tests:
Array.prototype.find
const found = !!arr.find(item => item == 1E5);
Array.prototype.findIndex
const found = arr.findIndex(item => item == 1E5) != -1;
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Array.prototype.find
Array.prototype.findIndex
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Related benchmarks:
find vs findIndex (Array prototype methods)
find vs findIndex (Array prototype methods) 22
find vs findindex with condition test
find vs indexOf (Array prototype methods)
Comments
Confirm delete:
Do you really want to delete benchmark?