1 min readApr 2, 2020
Hi Shadab Ali thanks for stopping by!
Yes your example will let you know if the value in a
is exactly null
, using the strict equality operator ===
:
let a = null
if(a===null){
console.log("a is null")
}
It will not execute the code in the if
statement for any value that is not exactly null
, such as undefined
.
Cheers, and happy coding!