HTML Preparation code:
x
 
1
2
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.20/lodash.min.js'></script>
Script Preparation code:
 
function makeid(length) {
   var result           = '';
   var characters       = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
   var charactersLength = characters.length;
   for ( var i = 0; i < length; i++ ) {
      result += characters.charAt(Math.floor(Math.random() * charactersLength));
   }
   return result;
}
var a = [];
for (let i=0; i<1000000; i++){
     a.push(makeid(15));   
}
Tests:
  • some

     
    _.some(a, x=>x===a[23424]);
    _.some(a, x=>x===a[0]);
    _.some(a, x=>x===a[99999]);
  • array.some

     
    a.some(x => x=== a[23424]);
    a.some(x=>x===a[0]);
    a.some(x=>x===a[99999]);
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    some
    array.some

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one year ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36
Chrome 116 on Mac OS X 10.15.7
View result in a separate tab
Test name Executions per second
some 172.6 Ops/sec
array.some 170.1 Ops/sec