Skip to main content
Version: 1.2.0

isEmpty

Using

This function to determine if a given value is empty.

  • Return true if the value is considered empty.
  • Return false otherwise.
Demo - use JSON
isEmpty(
)
false

Arguments

ArgumentTypeDescriptionExample
valueanyCan be any type"text"
{}
new Map()

Returns

boolean — value is empty true | false

Examples

isEmpty(undefined);
// true

isEmpty(34);
// false

isEmpty([]);
// true

isEmpty([1, 2]);
// false

isEmpty({});
// true

isEmpty({ name: 'Alina' });
// false

isEmpty(null);
// true

isEmpty('');
// true

isEmpty('some');
// false

Resources

📦 Since:1.2.0
📦 Last updated:1.2.0
📦 Available in:1.3.0