js check an object value is empty code example
Example 1: how to check if object is empty javascript
function isEmptyObject(obj) {
return !Object.keys(obj).length;
}
Example 2: js check if object is empty
> !!Object.keys(obj).length;
function isEmptyObject(obj) {
return !Object.keys(obj).length;
}
> !!Object.keys(obj).length;