Test name | Executions per second |
---|---|
IndexOf | 11372278.0 Ops/sec |
Includes | 12435647.0 Ops/sec |
some | 9593888.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')