Checks whether a value is a plain object (including Object.create(null)).
Object.create(null)
Unknown value to test.
true for objects whose prototype is Object.prototype or null (including Object.create(null)); false for arrays, class instances, and non-objects.
true
Object.prototype
null
false
isPlainObject({}); // trueisPlainObject(Object.create(null)); // trueisPlainObject([]); // falseisPlainObject(new Date()); // false Copy
isPlainObject({}); // trueisPlainObject(Object.create(null)); // trueisPlainObject([]); // falseisPlainObject(new Date()); // false
Checks whether a value is a plain object (including
Object.create(null)).