The object to check.
A boolean indicating whether the object is empty or not.
This function uses the Object.keys()
method to check if the object has any keys.
If the object has at least one key, the function returns false
, otherwise it returns true
.
T - The type of the values in the object.
const emptyObject = {};
const nonEmptyObject = { key: 'value' };
objIsEmpty(emptyObject);
//=> true
objIsEmpty(nonEmptyObject);
//=> false
Generated using TypeDoc
Checks if an object is empty. This function iterates over the keys of the provided object and checks if any key is defined.