If you want to detect all falsey values except zero:
if (!foo && foo !== 0)
So this will detect null
, empty strings, false
, undefined
, etc.
If you want to detect all falsey values except zero:
if (!foo && foo !== 0)
So this will detect null
, empty strings, false
, undefined
, etc.