JS Variables
Last Updated: March 15, 2022
If you want to check whether the variable has a value
if( value ) {
}
will evaluate to true
if value
is not:
- null
- undefined
- NaN
- empty string (“”)
- 0
- false
If you want to check whether the variable has a value
if( value ) {
}
will evaluate to true
if value
is not: