Test name | Executions per second |
---|---|
IndexOf | 9879778.0 Ops/sec |
Includes | 10501789.0 Ops/sec |
lodash | 2710077.5 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')
_.includes(array, 'sausage')