check if variable is not empty javascript or equal to 0 code example
Example: javascript check if variable is empty
if( value ) {
//
}
/**
* This will evaluate to true if value is not:
* null
* undefined
* NaN
* empty string ("")
* 0
* false
*/
if( value ) {
//
}
/**
* This will evaluate to true if value is not:
* null
* undefined
* NaN
* empty string ("")
* 0
* false
*/