Answers for "js if is null return empty string"

20

javascript null or empty

var myVar=null;

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

if (typeof myVar === 'undefined'){
    //myVar is undefined
}
Posted by: Guest on August-01-2019
1

javascript check if string is empty

var string = "not empty";
if(string == ""){
  console.log("Please Add");
}
else{
  console.log("You can pass"); // console will log this msg because our string is not empty
}
Posted by: Guest on June-19-2021

Code answers related to "js if is null return empty string"

Code answers related to "Javascript"

Browse Popular Code Answers by Language