Defaults. Start with a known plain settings object.
Gate.$.isPlainObject(options) must pass before merging.
Merge. Plain options override defaults via $.extend.
Frequently Asked Questions
jQuery.isPlainObject(obj) returns true when obj is a plain object — typically created with {} or new Object(). It returns false for arrays, strings, DOM nodes, window, null, and most class instances.
Arrays are objects in JavaScript, but they use Array.prototype. $.isPlainObject([]) returns false because [] is not a plain key/value map. Use jQuery.isArray() (or Array.isArray) for arrays.
jQuery.extend() merges plain object properties. Plugin code often checks if ($.isPlainObject(options)) before merging user settings so arrays or DOM nodes are not treated as option maps.
$.type returns "object" for arrays, dates, and plain objects alike. isPlainObject narrows the test to simple {}-style objects that are safe to treat as option maps.
Yes. Objects created with Object.create(null) have no inherited prototype and are treated as plain objects by jQuery — useful for dictionary maps without inherited properties.
No. The jQuery API notes that host objects (browser environment objects) can behave inconsistently across browsers. Prefer testing your own plain data, not every host object.