Test name | Executions per second |
---|---|
Native filter-map | 22.2 Ops/sec |
Lazy Lodash filter-map | 18.4 Ops/sec |
<script src="https://cdn.jsdelivr.net/npm/lodash@4.17.4/lodash.min.js"></script>
var data = Array(1000000).fill({ filtering: true, mapping: 42 });
data.filter(({ filtering }) => filtering).map(({ mapping }) => mapping)
_(data).filter('filtering').map('mapping').value()