HTML Preparation code:
AخA
 
1
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.15/lodash.min.js'></script>
Script Preparation code:
x
 
 var arr = [];
 for (let i = 0; i < 10000; i++) {
     arr.push({
         id: i,
         age: Math.random() * Math.floor(100)
     });
 }
Tests:
  • Native find with check

     
    !!arr && typeof arr === "array" && arr.find(({age}) => age < 70) 
  • Lodash find

     
    _.find(arr, ({age}) => age < 70)
  • Native find

     
    arr.find(({age}) => age < 70) 
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Native find with check
    Lodash find
    Native find

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 4 years ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36
Chrome 81 on Mac OS X 10.14.6
View result in a separate tab
Test name Executions per second
Native find with check 7625951.0 Ops/sec
Lodash find 3101895.0 Ops/sec
Native find 14238797.0 Ops/sec