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
Test name
Executions per second
undefined
155064144.0 Ops/sec
typeof
155152272.0 Ops/sec
in
154979344.0 Ops/sec
hasOwnProperty
154580976.0 Ops/sec
bool
155062736.0 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;