isEmpty
Checks if a value is empty.
- Strings:
'' - Arrays:
length === 0 - Maps/Sets:
size === 0 - Objects: no own enumerable keys
Usage
isEmpty(value: string | object)
Checks if a value is empty.
- Strings:
'' - Arrays:
length === 0 - Maps/Sets:
size === 0 - Objects: no own enumerable keys
Parameters
valuestring | objectrequired
the value to test.
Returns
whether the supported value contains no elements or own enumerable properties.