js empty var code example
Example 1: javascript is not null
if(data !== null && data !== '') {
// do something
}
Example 2: javascript check if object is null or empty
if (typeof value !== 'undefined' && value) {
//deal with value'
};
if(data !== null && data !== '') {
// do something
}
if (typeof value !== 'undefined' && value) {
//deal with value'
};