Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.0 Safari/605.1.15
Safari 15
Mac OS X 10.15.7
Desktop
2 years ago
Test name Executions per second
lodash foreach 134135.6 Ops/sec
native with forEach 178796.6 Ops/sec
HTML Preparation code:
AخA
 
1
<script src="https://cdn.jsdelivr.net/lodash/4.16.0/lodash.min.js"></script>
Script Preparation code:
 
var value = {a: 30310, b: '100303', c: '3040494'}
Tests:
  • lodash foreach

     
    _.forEach(value, function(key){ console.log(key); });
  • native with forEach

     
    var arr = []
    Object.keys(value).forEach( function(key){ console.log(key); } )