Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
big object undefined vs. typeof vs. in vs. hasOwnProperty
(version: 0)
Object lookup performance
Comparing performance of:
undefined vs typeof vs in vs hasOwnProperty vs bool
Created:
4 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
var obj = {}; for (let i = 0; i < 1000000; i++) { const randomStr = Math.random().toString(36) + Math.random().toString(36); obj[randomStr] = randomStr; }
Tests:
undefined
undefined !== obj.d;
typeof
'undefined' !== typeof obj.d;
in
'd' in obj;
hasOwnProperty
obj.hasOwnProperty( 'd' );
bool
!! obj.d;
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (5)
Previous results
Fork
Test case name
Result
undefined
typeof
in
hasOwnProperty
bool
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. typeof vs. in vs. hasOwnProperty 2
undefined vs. typeof vs. in vs. hasOwnProperty big object
undefined vs. typeof vs. in vs. Object.prototype.hasOwnProperty
undefined vs. typeof vs. in vs. hasOwnProperty 222
Comments
Confirm delete:
Do you really want to delete benchmark?