make object empty js code example
Example 1: javascript check if object is empty
function isObjectEmpty(obj) {
return Object.keys(obj).length === 0;
}
Example 2: how to initialize empty javascript object
let obj = {};
function isObjectEmpty(obj) {
return Object.keys(obj).length === 0;
}
let obj = {};