javascript
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?
Similar Posts
- Remove all false, null, undefined and empty values from array using Lodash
- Javascript code to remove falsy value like null, undefined, false from array
- Remove empty, false, undefined values from array Javscript
- Methods to check empty array using javascript
- Assign items of arrays to multiple variable when creating it (Array Destructuring) Javascript(ES6)
- Javascript program to swap two numbers without using temporary variable
- How to Check if Arrays in a Object Are All Empty