<script> console.log(myVar != null); </script>
<script>
let myVar;
if(myVar != null) {
alert('Variable has value.');
}
else{
alert('Variable has no value.')
}
</script><script>
let myVar;
if(myVar != null && myVar != un.defined){
console.log("myVar has some value.");
} else {
console.log("myVar is un.defined.");
}
// output => myVar is un.defined.
</script>