Skip to main content
Version: Next

isPlainObject

Using

This function determines whether the given value is a plain object.

  • Returns true if the value is a regular object (created via {}, new Object(), Object.create(null)).
  • Returns false for arrays, functions, special objects (Date, Map, etc.), and non-object types.
Demo - use JSON
isPlainObject(
)
false

Arguments

ArgumentTypeDescriptionExample
valueunknownCan be any type"text"
2
undefined

Returns

booleantrue if value is a plain object, false otherwise

Examples

isPlainObject({});
// true

isPlainObject({ key: 'value' });
// true

isPlainObject(Object.create(null));
// true

isPlainObject(null);
// false

isPlainObject(Object.create({ value: 'text' }));
// false

isPlainObject(42);
// false

isPlainObject([]);
// false

isPlainObject(new Date());
// false

isPlainObject(() => {});
// false

Resources

📦 Since:1.3.0
📦 Last updated:1.3.0
📦 Available in:1.3.0