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