-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use of if(typeof value !== 'undefined')
?
#236
Comments
More like differenciating between null and undefined. |
Now, this is a little nuanced In nearly all cases, we should definitely prefer However, there are times where you want to check if a top level variable even exists in the first place For example, to check if variable b exists at the most outer scope, you can't use For that, So, it'd be great if you could find a way to create a script that mass updates the repos and we reviewed them one by one to see if the |
@gurgunday will make PRs and point them back to this issue. |
Noticed this in a few places in this repo:
https://github.com/fastify/fastify-helmet/blob/b0aacaee932e1629a6233c97424d739735b3293c/index.js#L25C31-L25C31
Never seen this before, does this have a performance benefit over the following?:
if(value)
if(value !== undefined)
The text was updated successfully, but these errors were encountered: