js if object is notempty code example
Example 1: javascript check if object is empty
function isObjectEmpty(obj) {
return Object.keys(obj).length === 0;
}
Example 2: jquery check if empty object
jQuery.isEmptyObject( object );
Example:
jQuery.isEmptyObject({}) // true
jQuery.isEmptyObject({ foo: "bar" }) // false