ObjectConstructor.isEmpty method
ObjectConstructor › isEmpty
Official
Checks if an object is empty.Signature:
isEmpty(object: Record<string, any>): booleanParameters:
| Parameter | Type | Description |
|---|---|---|
| object | Record<string, any> | The object to check. |
Returns: boolean — true if the object is empty, false otherwise.
Example:
console.log(Object.isEmpty({})); // trueconsole.log(Object.isEmpty({ a: 1 })); // false