Search code snippets, questions, articles...

Check if a variable is null, empty, undefined or false Javascript

You can check whether a variable is null, empty, undefined, or false using below code snippet.
if (variable_name) {
    //variable_name will not be null, empty, undefined or false
}
Was this helpful?
0 Comments
Programming Feeds
Learn something new everyday on Devsheet