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 (X11; Linux x86_64; rv:132.0) Gecko/20100101 Firefox/132.0
Browser:
Firefox 132
Operating system:
Linux
Device Platform:
Desktop
Date tested:
one year ago
hasOwnProperty
2042.4M/s
in
2036.7M/s
undefined
2031.9M/s
bool
2027.7M/s
typeof
2026.4M/s
View exact numbers
Test name
Executions per second
✓
hasOwnProperty
2,042,433,664 Ops/sec
in
2,036,686,592 Ops/sec
undefined
2,031,948,160 Ops/sec
bool
2,027,740,416 Ops/sec
typeof
2,026,365,824 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;