DEV Community

Discussion on: Advanced TypeScript Types cheat sheet (with examples)

Collapse
 
chico1992 profile image
chico1992

You should explicitly check for bar===null as in your case the empty string will also make !bar true

Collapse
 
khrisl33t profile image
kHRISl33t

you are right, thanks :)