Test name | Executions per second |
---|---|
array find | 173482848.0 Ops/sec |
array some | 174052736.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');