![]() |
VOOZH | about |
Lodash _.isEmpty() method checks if the value is an empty object, collection, map, or set. Objects are considered empty if they have no own enumerable string keyed properties. Collections are considered empty if they have a 0 length. Similarly, maps and sets are considered empty if they have a 0 size.
_.isEmpty(value);Parameters:
Return Value:
Example 1: In this example, the _.isEmpty() method returns true as null is an empty value itself which does not hold any value.
Output:
The Value is Empty : trueExample 2: In this example, the _.isEmpty() method returns true as the length of the array is zero.
Output:
The Value is Empty : trueExample 3: In this example, the _.isEmpty() method returns true for both of the Boolean values.
Output:
The Value is Empty : true