Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36
Chrome 108
Mac OS X 10.15.7
Desktop
2 years ago
Test name Executions per second
Lodash 12465042.0 Ops/sec
JS some 154118720.0 Ops/sec
HTML Preparation code:
x
 
1
2
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.min.js'></script>
Script Preparation code:
 
const array = ['apples', 'bananas', 'oranges', 'melons'];
Tests:
  • Lodash

     
    const array = ['apples', 'bananas', 'oranges', 'melons'];
    const found = _.some(array, s => s === 'oranges');
  • JS some

     
    const array = ['apples', 'bananas', 'oranges', 'melons'];
    const found = array.some(s => s === 'oranges');