Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.64 Safari/537.36
Chrome 101
Mac OS X 10.15.7
Desktop
2 years ago
Test name Executions per second
Lodash reduce 3246493.2 Ops/sec
Lodash fp reduce 2885900.0 Ops/sec
HTML Preparation code:
AخA
 
1
<script src='https://cdn.jsdelivr.net/g/lodash@4(lodash.min.js+lodash.fp.min.js)'></script>
Script Preparation code:
 
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;
Tests:
  • Lodash reduce

     
    _.reduce(array, reducer, '')
  • Lodash fp reduce

     
    fp.reduce(reducer, '', array)