JS is determined whether a valid value is null or undefined

On the code:

 if ( some_variable == null ){
   // some_variable is either null or undefined
 }

More Code:

if ( !some_variable ) {
  // some_variable is either null, undefined, 0, NaN, false, or an empty string
}
He published 188 original articles · won praise 88 · views 580 000 +

Guess you like

Origin blog.csdn.net/henryhu712/article/details/103751055