Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.54 Safari/537.36
Chrome 94
Linux
Desktop
3 years ago
Test name Executions per second
Lodash 9.8 Ops/sec
Native 7.4 Ops/sec
HTML Preparation code:
x
 
1
2
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.min.js'></script>
Script Preparation code:
 
var numbers = [...Array(10000000).keys()];
Tests:
  • Lodash

     
    _.reduce(numbers, (sum, n) => sum + n, 0)
  • Native

     
    numbers.reduce((sum, n) => sum + n, 0)