How to check if a Variable Is Not Null in Javascript?
javascript is not null
if(data !== null && data !== '') {
// do something
}
Check if a Variable is Not NULL in JavaScript
Copied!
const a = 'hello';
if (a !== null) {
console.log('✅ a is NOT null');
} else {
console.log('⛔️ a is null');
}