Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript check if Empty string, undefined, null

Use for Empty string, undefined, null, ...
//To check for a truthy value:

if (strValue) {
    // strValue was non-empty string, true, 42, Infinity, [], ...
}

//To check for a falsy value:
if (!strValue) {
    // strValue was empty string, false, 0, null, undefined, ...
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #check #Empty #null
ADD COMMENT
Topic
Name
8+2 =