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 (Macintosh; Intel Mac OS X 10.15; rv:120.0) Gecko/20100101 Firefox/120.0
Browser:
Firefox 120
Operating system:
Mac OS X 10.15
Device Platform:
Desktop
Date tested:
2 years ago
in
789.8M/s
bool
788.4M/s
typeof
783.2M/s
hasOwnProperty
781.5M/s
undefined
777.9M/s
View exact numbers
Test name
Executions per second
✓
in
789,776,256 Ops/sec
bool
788,384,576 Ops/sec
typeof
783,184,128 Ops/sec
hasOwnProperty
781,517,824 Ops/sec
undefined
777,930,688 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;