Test name | Executions per second |
---|---|
Native findIndex | 23056980.0 Ops/sec |
_.findIndex | 7568753.0 Ops/sec |
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.min.js'></script>
var users = [
{ 'user': 'joey', 'age': 28 },
{ 'user': 'ross', 'age': 31 },
{ 'user': 'chandler', 'age': 30 },
{ 'user': 'jessika', 'age': 21 },
{ 'user': 'amanda', 'age': 17 }
]
users.findIndex(u => u.age === 30)
_.findIndex(users, u => u.age === 30)