HTML Preparation code:
AخA
 
1
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.core.js"></script>
Tests:
  • array for

    x
     
    var a = ['hello', 'a', 'bc'];
    function find(target, arr) {
     for (let i = 0; i < arr.length; i++) {
       if (target === arr[i]) return true;
     }
     return false;
    }
    var b = find('bc', a);
  • array some

     
    var a = ['hello', 'a', 'bc'];
    var b = a.some(item => item === 'bc');
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    array for
    array some

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one year ago)
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Mobile Safari/537.36
Chrome Mobile 119 on Android
View result in a separate tab
Test name Executions per second
array for 113220272.0 Ops/sec
array some 153785904.0 Ops/sec