Check if object is Empty
Javascript
Use this function to check if object is empty:
javascript
function isEmpty(object) {
return Object.getOwnPropertyNames(object).length === 0
}
Usage example:
const object = {};
isEmpty(object); // true
Use this function to check if object is empty:
javascript
function isEmpty(object) {
return Object.getOwnPropertyNames(object).length === 0
}
const object = {};
isEmpty(object); // true