Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36
Chrome 76
Mac OS X 10.14.6
Desktop
5 years ago
Test name Executions per second
array find 1993471.9 Ops/sec
_.find 1447335.0 Ops/sec
HTML Preparation code:
AخA
 
1
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.11/lodash.core.js"></script>
Script Preparation code:
x
 
var users = {
  0:{ 'user': 'joey',  'age': 32 },
  1:{ 'user': 'ross',    'age': 41 },
  2:{ 'user': 'chandler', 'age': 39 }
}
Tests:
  • array find

     
    // Native
    Object.values(users).find(function (o) { return o.age < 40; })
  • _.find

     
    _.find(users, function (o) { return o.age < 40; })