Test name | Executions per second |
---|---|
Lodash | 9.8 Ops/sec |
Native | 7.4 Ops/sec |
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.min.js'></script>
var numbers = [Array(10000000).keys()];
_.reduce(numbers, (sum, n) => sum + n, 0)
numbers.reduce((sum, n) => sum + n, 0)