Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
undefined vs. typeof vs. in vs. hasOwn
(version: 1)
Object lookup performance
Comparing performance of:
undefined vs typeof vs in vs hasOwn vs bool
Created:
one year ago
by:
Guest
Jump to the latest result
Script Preparation code:
const 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;
hasOwn
Object.hasOwn(obj, '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
hasOwn
bool
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Mobile Safari/537.36
Browser/OS:
Chrome Mobile 131 on Android
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
undefined
37448980.0 Ops/sec
typeof
40375368.0 Ops/sec
in
35642988.0 Ops/sec
hasOwn
19054142.0 Ops/sec
bool
39150148.0 Ops/sec
Related benchmarks:
undefined vs. typeof vs. in vs. hasOwnProperty
undefined vs. typeof vs. in vs. hasOwnProperty vs exists vs double bang
undefined vs. typeof vs. in vs. hasOwnProperty 23
undefined vs. typeof vs. in vs. hasOwnProperty vs. Void 0
undefined vs. typeof vs. in vs. hasOwnProperty not
undefined vs. typeof vs. in vs. hasOwnProperty vs Object.hasOwn
undefined vs. typeof vs. in vs. hasOwnProperty exists
undefined vs. typeof vs. in vs. hasOwnPropertyjjj
undefined vs. typeof vs. in vs. hasOwnProperty vs. hasOwn
Comments
Confirm delete:
Do you really want to delete benchmark?