Test name | Executions per second |
---|---|
Lodash | 2139758.2 Ops/sec |
Native | 5089964.5 Ops/sec |
Native with Entries | 6023474.0 Ops/sec |
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.min.js'></script>
var max2 = 100000;
var data = {};
for (var i = 0; i <= max2; i++) { data['id'] = i; }
_.omitBy(data, (item) => item.id === 5000)
Object.keys(data).reduce((result, key) => {
if (key !== 5000) {
result[key] = data[key];
}
return result;
}, {})
Object.entries(data).reduce((result, entry) => {
if (entry[1] !== 5000) {
result[entry[0]] = entry[1];
}
return result;
}, {})