Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
undefined vs typeof vs !!
(version: 0)
undefined vs typeof vs !!
Comparing performance of:
strict vs typeof vs !! vs void 0;
Created:
4 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
var value;
Tests:
strict
value !== undefined
typeof
typeof value !== "undefined"
!!
!!value
void 0;
value !== void 0;
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (4)
Previous results
Fork
Test case name
Result
strict
typeof
!!
void 0;
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36 Edg/130.0.0.0
Browser/OS:
Chrome 130 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
strict
148639696.0 Ops/sec
typeof
191992928.0 Ops/sec
!!
191977520.0 Ops/sec
void 0;
198056752.0 Ops/sec
Related benchmarks:
if(!variable) vs if(variable===undefined) performance
if(typeof <var> ===undefined) vs if(<var>)
typeof !== undefined vs strict !equal
typeof number vs not typeof undefined vs undefined
Comments
Confirm delete:
Do you really want to delete benchmark?