Test name | Executions per second |
---|---|
Native filter-map | 15.7 Ops/sec |
Lazy Lodash filter-map | 12.2 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()