Test name | Executions per second |
---|---|
Lodash | 12465042.0 Ops/sec |
JS some | 154118720.0 Ops/sec |
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.min.js'></script>
const array = ['apples', 'bananas', 'oranges', 'melons'];
const array = ['apples', 'bananas', 'oranges', 'melons'];
const found = _.some(array, s => s === 'oranges');
const array = ['apples', 'bananas', 'oranges', 'melons'];
const found = array.some(s => s === 'oranges');