How does js determine that undefined null is empty at the same time?

  1. now I judge whether a variable is valid by the following way (that is, undefined null " each judge once):
if( (this.$route.query.openid != undefined || this.$route.query.openid != null || this.$route.query.openid != "" ) && window.localStorage.getItem("openid") != "")
{
      ......
 }

I would like to ask JS or Vue or ES is there any way to directly determine whether a variable is valid at once?

Mar.21,2021

the answer of @ original sin adopted by the landlord is not accurate enough. With a rigorous and responsible attitude, it is necessary to add that when making a judgment first, if a variable is not declared, it cannot be judged directly. For example, the following judgment will report an error.

const nullReg = /^(undefined|null|)$/;
if(!nullReg.test(this.$route.query.openid) && !nullReg.test(window.localStorage.getItem('openid'))) {
  ...
}
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e45e8e-44b69.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e45e8e-44b69.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?