Checks if a given value is an empty object (i.e., an object with no properties).
The value to check.
true if the value is an object and has no properties, otherwise false. Returns false for null, undefined, or non-object values, as well as arrays.
true
false
null
undefined
isEmptyObject({}); // trueisEmptyObject({ key: 'value' }); // falseisEmptyObject([]); // falseisEmptyObject(null); // falseisEmptyObject(undefined); // falseisEmptyObject('string'); // false Copy
isEmptyObject({}); // trueisEmptyObject({ key: 'value' }); // falseisEmptyObject([]); // falseisEmptyObject(null); // falseisEmptyObject(undefined); // falseisEmptyObject('string'); // false
Checks if a given value is an empty object (i.e., an object with no properties).