To check a null value is it correct to do (if (Shi...
# suitescript
r
To check a null value is it correct to do (if (ShipAttention == “”)) or if (!ShipAttention)?
e
The latter
The former is checking specifically for an empty string
The latter is checking for a falsy value
and
null
is falsy
r
Thanks @erictgrubaugh!
1
e
This comparison of null and undefined might also be of interest
So if you were really only interested in
null
and not other falsy values, you could do
if (ShipAttention === null)