Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
hasOwn vs hasOwnProperty vs typeof
Object lookup performance
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/119.0.0.0 Safari/537.36
Browser:
Chrome 119
Operating system:
Windows
Device Platform:
Desktop
Date tested:
2 years ago
hasOwnProperty
23.5M/s
typeof
23.1M/s
hasOwn
8.6M/s
View exact numbers
Test name
Executions per second
✓
hasOwnProperty
23,500,018 Ops/sec
typeof
23,149,778 Ops/sec
hasOwn
8,553,112 Ops/sec
Script Preparation code:
var obj = { a: 1, b: 2, c: 3, d: 4, e: 5 };
Tests:
typeof
typeof obj.d !== "undefined";
hasOwn
Object.hasOwn(obj, 'd')
hasOwnProperty
obj.hasOwnProperty( 'd' );