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 (Windows NT 10.0; Win64; x64; rv:133.0) Gecko/20100101 Firefox/133.0
Browser:
Firefox 133
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
in
3478.8M/s
typeof
3307.1M/s
bool
3300.0M/s
undefined
3267.6M/s
hasOwnProperty
3181.6M/s
View exact numbers
Test name
Executions per second
✓
in
3,478,770,944 Ops/sec
typeof
3,307,081,472 Ops/sec
bool
3,299,988,736 Ops/sec
undefined
3,267,626,496 Ops/sec
hasOwnProperty
3,181,593,600 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;