I have one validation that I need to perform. When a string is null
or undefined
or ""
I need to show a message like "unable to perform further steps". If I do have values I need to proceed with further validations. I tried below code, but it doesn't work.
function test(){
var value = undefined; // api returns undefined
if(value != "" || value != undefined || value != null){
alert("ID::: " + value);
//next validations
}else{
alert("Id is blank, we are unable to process the request!!!");
return false;
}
}
<button type="button"onclick="test()">Click</button>