jQuery.isEmptyObject(object) (alias $.isEmptyObject) returns true when the object has no enumerable properties (since jQuery 1.4). Empty {} is true; any key makes it false.
jQuery.isEmptyObject() is available since jQuery 1.4+ in all browsers that load jQuery. It is a data utility — no special DOM API required.
✓ jQuery 1.4+ · All browsers with jQuery
jQuery.isEmptyObject()
Works wherever jQuery runs in the browser. For own-property checks without jQuery, use Object.keys(obj).length === 0 on plain objects.
100%Browser support
Google ChromeAll versions · Desktop & Mobile
Full support
Mozilla FirefoxAll versions · Desktop & Mobile
Full support
Apple SafariAll versions · macOS & iOS
Full support
Microsoft EdgeAll versions · Chromium & Legacy
Full support
Internet ExplorerIE 6+ · Legacy environments
Full support
OperaAll modern versions
Full support
$.isEmptyObject()Browsers
Bottom line: Use $.isEmptyObject(obj) on plain objects in jQuery apps. Prefer Object.keys when you only need own properties.
Analysis
Performance Notes
Approach
Cost
Best for
$.isEmptyObject(obj)
O(k) keys seen
Empty checks in jQuery code
Object.keys(obj).length === 0
O(n) own keys
Own-property emptiness
Skip check + always extend
Extra work
Tiny option objects (usually fine)
Option objects are usually tiny. Prefer clear guards over micro-optimizing emptiness checks.
Remember
Key Takeaways
Role:$.isEmptyObject(obj) → no enumerable keys.
Input: plain objects only — pair with isPlainObject.
Official:{} true · { foo: "bar" } false.
Own keys: prefer Object.keys when that is all you need.
One line: use $.isEmptyObject on plain objects to detect “no settings” — confirm plain first, and normalize null/undefined.
Frequently Asked Questions
jQuery.isEmptyObject(object) returns true when the object has no enumerable properties (as seen by for...in). An empty literal {} returns true; { foo: "bar" } returns false.
Yes. The official docs say the argument should always be a plain JavaScript Object. DOM nodes, primitives, and host objects may give inconsistent results across browsers. Confirm with $.isPlainObject() when unsure.
Object.keys counts only own enumerable properties. Since jQuery 1.4, isEmptyObject uses for...in and can also see inherited enumerable properties on the prototype. For typical {} literals both usually agree.
The method expects an object. Passing null or undefined can throw when the internal loop runs. Guard first, or normalize with options || {}.
It is meant for plain objects, not arrays. Use $.isArray() / Array.isArray() and .length for arrays.
A common pattern: if user options are empty, keep defaults; otherwise merge with $.extend({}, defaults, userOptions).
Yes, if jQuery is loaded. It is a data utility and does not need a DOM. Many Node apps prefer Object.keys(obj).length === 0 for own-property checks.