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