In JavaScript:
if (value) {
...
}will evaluate to true if and only if value is NOT:
undefinednullNaN(Not a Number)""(empty string)0false
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:
undefinednullNaN (Not a Number)"" (empty string)0falseAll those values are considered falsy and return false with the if statement.