isEmpty source npm
_.isEmpty(value)
Checks if value
is empty. A value is considered empty unless it's an
arguments
object, array, string, or jQuery-like collection with a length
greater than 0
or an object with own enumerable properties.
Arguments
- value (Array|Object|string)
The value to inspect.
Returns (boolean)
Returns true
if value
is empty, else false
.
Example
_.isEmpty(null);
// => true
_.isEmpty(true);
// => true
_.isEmpty(1);
// => true
_.isEmpty([1, 2, 3]);
// => false
_.isEmpty({ 'a': 1 });
// => false