how to check boject is empty javascript code example
Example 1: how to check if object is empty javascript
function isEmptyObject(obj) {
return !Object.keys(obj).length;
}
Example 2: check if js object is empty
JSON.stringify({}) !== '{}';
function isEmptyObject(obj) {
return !Object.keys(obj).length;
}
JSON.stringify({}) !== '{}';