Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36
Chrome 68
Mac OS X 10.12.6
Desktop
6 years ago
Test name Executions per second
native 368746.8 Ops/sec
lodash 57971.6 Ops/sec
HTML Preparation code:
AخA
 
1
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.4/lodash.min.js"></script>
Script Preparation code:
x
 
var arr = [];
for (var i = 0; i < 1000; i++) {
  arr[i] = i;
}
Tests:
  • native

     
    arr.forEach((a)=>{a * 2 * 5;} )
  • lodash

     
    _.forEach(arr,(a)=>{a * 2 * 5;})