Skip to content

ObjectConstructor.isEmpty method

ObjectConstructor › isEmpty

Official

Checks if an object is empty.

Signature:

isEmpty(object: Record<string, any>): boolean

Parameters:

Parameter Type Description
object Record<string, any> The object to check.

Returns: booleantrue if the object is empty, false otherwise.

Example:

console.log(Object.isEmpty({})); // true
console.log(Object.isEmpty({ a: 1 })); // false