Test name | Executions per second |
---|---|
omit | 4880638.5 Ops/sec |
filter | 5173299.0 Ops/sec |
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.min.js'></script>
const foo = ['field1', 'field2', 'field3', 'field4', 'field5'];
_.reject(foo, nextField => nextField === 'field4');
const foo = ['field1', 'field2', 'field3', 'field4', 'field5'];
_.filter(foo, nextField => nextField !== 'field4');