Test name | Executions per second |
---|---|
IndexOf | 8425386.0 Ops/sec |
Includes | 9228847.0 Ops/sec |
some | 8603833.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')