Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
IndexOf vs FindIndex 4
(version: 0)
Comparing performance of:
FindIndex vs indexOf
Created:
6 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
var arr = [ {id: 1, name: 'ola1'}, {id: 2, name: 'ola2'}, {id: 3, name: 'ola3'}, {id: 4, name: 'ola4'}, {id: 5, name: 'ola5'}, {id: 5, name: 'ola5'}, {id: 5, name: 'ola5'}, {id: 5, name: 'ola5'}, {id: 5, name: 'ola5'}, {id: 5, name: 'ola5'}, {id: 5, name: 'ola5'}, {id: 5, name: 'ola5'}, {id: 5, name: 'ola5'}, {id: 5, name: 'ola5'}, {id: 5, name: 'ola5'}, {id: 5, name: 'ola5'}, {id: 5, name: 'ola5'}, {id: 5, name: 'ola5'}, {id: 5, name: 'ola5'} ];
Tests:
FindIndex
function check(item) { return item.id === 1; } arr.findIndex(check)
indexOf
var last = {id: 1, name: 'ola1'} arr.indexOf(last);
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:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Related benchmarks:
findIndex vs map
IndexOf vs FindIndex 3
findIndex vs indexOf on array of objs
findIndex vs indexOf - JavaScript performance v2
Comments
Confirm delete:
Do you really want to delete benchmark?