Test name | Executions per second |
---|---|
array find | 105795648.0 Ops/sec |
array some | 105772568.0 Ops/sec |
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.core.js"></script>
var a = ['hello', 'a', 'bc'];
var b = a.find(item => item === 'bc');
var a = ['hello', 'a', 'bc'];
var b = a.some(item => item === 'bc');