Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36
Chrome 127
Mac OS X 10.15.7
Desktop
5 months ago
Test name Executions per second
Lodash 3225895.0 Ops/sec
Native 6184116.0 Ops/sec
Native with Entries 7744257.0 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 max2 = 100000;
var data = {};
for (var i = 0; i <= max2; i++) { data['id'] = i; }
Tests:
  • Lodash

     
    _.omitBy(data, (item) => item.id === 5000)
  • Native

     
    Object.keys(data).reduce((result, key) => {
      if (key !== 5000) {
        result[key] = data[key];
      }
      return result;
    }, {})
  • Native with Entries

     
    Object.entries(data).reduce((result, entry) => {
      if (entry[1] !== 5000) {
        result[entry[0]] = entry[1];
      }
      return result;
    }, {})