if (!obj) return true; if (typeof obj === 'object') { for (const entry of Object.values(obj)) { if (!deepCheckEmptyArray(entry)) { return false; } } return true; } code example
Example: javascript check if variable is object
//checks if is object, null val returns false
function isObject(val) {
if (val === null) { return false;}
return ( (typeof val === 'function') || (typeof val === 'object') );
}
var person = {"name":"Boby Snark"};
isObject(person);//true