Answers for "how to check for type null in javascript"

10

javascript check if null

if (variable === null) { //Executes only if variable is null but not undefined
  //Code here
}

if (variable == null) { //Executes if variable is null OR undefined
  //Code here
}
Posted by: Guest on May-20-2020
0

null check in javascript

if(!pass || !cpass || !email || !cemail || !user) {
   // Code here
}
// Which will check for empty strings (""), null, undefined, false and the numbers 0 and NaN
Posted by: Guest on June-15-2021

Code answers related to "how to check for type null in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language