HTML Preparation code:
x
 
1
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.11/lodash.core.js"></script>
2
Script Preparation code:
 
var strings = [
    'one', 'two', 'three'
]
var regex = /^(one|two|three)$/;
var input = 'three'
Tests:
  • array find

     
    // Native
    !!strings.find(function (o) { return o == input; })
  • _.find

     
    !!_.find(users, function (o) { return o==input; })
  • regex

     
    regex.test(input)
  • regex (i)

     
    regex.test(input)
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    array find
    _.find
    regex
    regex (i)

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one year ago)
Mozilla/5.0 (iPhone; CPU iPhone OS 16_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.5.2 Mobile/15E148 Safari/604.1
Mobile Safari 16 on iOS 16.5.1
View result in a separate tab
Test name Executions per second
array find 7071586.0 Ops/sec
_.find 0.0 Ops/sec
regex 12618056.0 Ops/sec
regex (i) 12069677.0 Ops/sec