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>
Script Preparation code:
x
 
function shuffle(array) {
  let currentIndex = array.length,  randomIndex;
  // While there remain elements to shuffle.
  while (currentIndex != 0) {
    // Pick a remaining element.
    randomIndex = Math.floor(Math.random() * currentIndex);
    currentIndex--;
    // And swap it with the current element.
    [array[currentIndex], array[randomIndex]] = [
      array[randomIndex], array[currentIndex]];
  }
  return array;
}
Tests:
  • array find

     
    var a = shuffle('The quick brown fox jumps over the lazy dog.'.split(''));
    var b = a.find(item => item === 'x');
  • array some

     
    var a = shuffle('The quick brown fox jumps over the lazy dog.'.split(''));
    var b = a.some(item => item === 'x');
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    array find
    array some

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 3 years ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:99.0) Gecko/20100101 Firefox/99.0
Firefox 99 on Windows
View result in a separate tab
Test name Executions per second
array find 489265.5 Ops/sec
array some 478388.2 Ops/sec