Skip to content

isEmpty()

isEmpty(value): boolean

Defined in: src/utils/objectUtils.ts:145

Checks if a value is an empty object, array, string, or falsy value.

Parameters

value

unknown

The value to check.

Returns

boolean

true if the value is empty or falsy, otherwise false.

Example

tsx
isEmpty({}); // true
isEmpty([]); // true
isEmpty(''); // true
isEmpty(null); // true
isEmpty(0); // false
isEmpty(true); // false

Released under the MIT License.