Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript check if undefined or null

// simple check do the job
if (myVar) {
 // comes here either myVar is not null,
 // or myVar is not undefined,
 // or myVar is not '' (empty string).
}
 
PREVIOUS NEXT
Tagged: #javascript #check #undefined #null
ADD COMMENT
Topic
Name
8+5 =