Test name | Executions per second |
---|---|
indexOf | 1837045.1 Ops/sec |
Lodash IndexOf | 928184.4 Ops/sec |
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.min.js'></script>
data = Array.from({length: 1000}).map((e, index) => index);
const result = data.indexOf(999);
const result = _.indexOf(data, 999);