How to check undefined, empty and null in JavaScript/JQuery ?
In this post we will give you information about How to check undefined, empty and null in JavaScript/JQuery ?. Hear we will give you detail about How to check undefined, empty and null in JavaScript/JQuery ?And how to use it also give you demo for it if it is necessary.
If you are working on jquery and However you want to check variable is undefined or not then you can easily check by typeof operator, which is simple, fast and cross-platform:
if(typeof i == "undefined"){
alert('undefined');
}
If you are working on jquery and However you want to check variable is empty or not then you can easily check by compare with empty string:
if(i == ''){
alert('Empty');
}
If you are working on jquery and However you want to check variable is null or not then you can easily check by compare with “null”:
if(i == null || i == NULL){
alert('null');
}
Try this……
Hope this code and post will helped you for implement How to check undefined, empty and null in JavaScript/JQuery ?. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve us. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs