Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
lodash has vs object.hasOwn
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 OPR/106.0.0.0
Browser:
Opera 106
Operating system:
Windows
Device Platform:
Desktop
Date tested:
2 years ago
object.hasown true
7.1M/s
object.hasown false
7.1M/s
lodash has true
3.8M/s
lodash has false
3.7M/s
View exact numbers
Test name
Executions per second
✓
object.hasown true
7,077,170 Ops/sec
object.hasown false
7,054,988 Ops/sec
lodash has true
3,799,032 Ops/sec
lodash has false
3,661,034 Ops/sec
HTML Preparation code:
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.min.js'></script>
Script Preparation code:
// Example consider object var data = [{ a: 'ding' }]; var data_0 = [];
Tests:
lodash has true
const value = _.has(data,'0.a');
lodash has false
const value = _.has(data_0,'0.c');
object.hasown true
const value = Object.hasOwn(data[0]??{}, 'a')
object.hasown false
const value = Object.hasOwn(data_0[0]??{}, 'c')