In JavaScript:
if (value) {
...
}
will evaluate to true
if and only if value
is NOT:
undefined
null
NaN
(Not a Number)""
(empty string)0
false
All those values are considered falsy and return false
with the if
statement.
In JavaScript:
if (value) {
...
}
will evaluate to true
if and only if value
is NOT:
undefined
null
NaN
(Not a Number)""
(empty string)0
false
All those values are considered falsy and return false
with the if
statement.