check if variable is null or not javascript code example
Example 1: javascript not null
if (variable !== null) {
console.log("Var is NOT null");
}
Example 2: javascript null check
if (Var === null) {
//code goes here
}
if (variable !== null) {
console.log("Var is NOT null");
}
if (Var === null) {
//code goes here
}