Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Find item in array
(version: 0)
Comparing performance of:
Native find vs Lodash find vs Lodash some vs Native some vs Native find index vs Complex
Created:
7 years ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.10/lodash.core.js"></script>
Script Preparation code:
var selected = [{ id: '1' }, { id: '2' }, { id: '3' }];
Tests:
Native find
var found = selected.find(m => m.id === '3');
Lodash find
var found = _.find(selected, m => m.id === '3');
Lodash some
var found = _.some(selected, m => m.id === '3')
Native some
var found = selected.some(m => m.id === '3')
Native find index
var found = selected.findIndex(m => m.id === '3')
Complex
var indexes = selected.map(s => s.id); var found = selected.includes('3');
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (6)
Previous results
Fork
Test case name
Result
Native find
Lodash find
Lodash some
Native some
Native find index
Complex
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 item in array - Fork
lodash filter vs array.filter
lodash vs es6 in find method
native find vs lodash _.find equal
Comments
Confirm delete:
Do you really want to delete benchmark?