const emptyObject = {
}
// Using keys method of Object class
let isObjectEmpty = (object) => {
return Object.keys(object).length === 0;
}
console.log(isObjectEmpty(emptyObject)); // true
// Using stringify metod of JSON class
isObjectEmpty = (object) => {
return JSON.stringify(object) === "{}";
}
console.log(isObjectEmpty(emptyObject)); // true