Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
undefined vs. typeof vs. in vs. hasOwnProperty
Object lookup performance
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Android 13; Mobile; rv:124.0) Gecko/124.0 Firefox/124.0
Browser:
Firefox Mobile 124
Operating system:
Android
Device Platform:
Mobile
Date tested:
2 years ago
typeof
155.2M/s
undefined
155.1M/s
bool
155.1M/s
in
155.0M/s
hasOwnProperty
154.6M/s
View exact numbers
Test name
Executions per second
✓
typeof
155,152,272 Ops/sec
undefined
155,064,144 Ops/sec
bool
155,062,736 Ops/sec
in
154,979,344 Ops/sec
hasOwnProperty
154,580,976 Ops/sec
Script Preparation code:
var obj = { a: 1, b: 2, c: 3, d: 4, e: 5 };
Tests:
undefined
undefined !== obj.d;
typeof
'undefined' !== typeof obj.d;
in
'd' in obj;
hasOwnProperty
obj.hasOwnProperty( 'd' );
bool
!! obj.d;