Test name | Executions per second |
---|---|
IndexOf | 24950636.0 Ops/sec |
Includes | 26874408.0 Ops/sec |
some | 23786788.0 Ops/sec |
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.min.js'></script>
var array = ['banana', 'sausage', 'jesus']
array.indexOf('sausage') !== 1
array.includes('sausage')
array.some(v => v === 'sausage')