Test name | Executions per second |
---|---|
IndexOf | 10193029.0 Ops/sec |
Includes | 10926120.0 Ops/sec |
lodash | 2627197.2 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')