Test name | Executions per second |
---|---|
Lodash reduce | 1104173.5 Ops/sec |
Lodash fp reduce | 977578.1 Ops/sec |
<script src='https://cdn.jsdelivr.net/g/lodash@4(lodash.min.js+lodash.fp.min.js)'></script>
var fp = _.noConflict();
var array = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'];
var reducer = (r, x) => r + x;
_.reduce(array, reducer, '')
fp.reduce(reducer, '', array)