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