MBS
0
Q:

javascript is null

if(data !== null && data !== '') {
   // do something
}
2
var myVar=null;

if(myVar === null){
    //I am null;
}

if (typeof myVar === 'undefined'){
    //myVar is undefined
}
2
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
}
4
if (Var === null) { 
//code goes here
}
4
if (Var === null) { 
//code goes here
}
3

New to Communities?

Join the community