Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript check if variable is empty

if( value ) {
  //
}

/**
* This will evaluate to true if value is not:
* null
* undefined
* NaN
* empty string ("")
* 0
* false
*/
Source by www.freecodecamp.org #
 
PREVIOUS NEXT
Tagged: #javascript #check #variable #empty
ADD COMMENT
Topic
Name
7+4 =