Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
undefined vs. typeof vs. in vs. hasOwnProperty vs. Object.prototype.hasOwnProperty.call
(version: 0)
Object lookup performance
Comparing performance of:
undefined vs typeof vs in vs hasOwnProperty vs bool vs Object.prototype.hasOwnProperty.call
Created:
5 years ago
by:
Guest
Jump to the latest result
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;
Object.prototype.hasOwnProperty.call
Object.prototype.hasOwnProperty.call(obj, 'd')
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (6)
Previous results
Fork
Test case name
Result
undefined
typeof
in
hasOwnProperty
bool
Object.prototype.hasOwnProperty.call
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Related benchmarks:
undefined vs. typeof vs. in vs. hasOwnProperty
undefined vs. hasOwnProperty
undefined vs. typeof vs. in vs. hasOwnProperty 2
undefined vs. typeof vs. in vs. Object.prototype.hasOwnProperty
Comments
Confirm delete:
Do you really want to delete benchmark?