how to set object empty in 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 = {};