Checks if value is a plain object, that is, an object created by the Object constructor or one with a [[Prototype]] of null.
value
Object
[[Prototype]]
null
1.0.0
isPlainObject(new Foo);// => false Copy
isPlainObject(new Foo);// => false
isPlainObject([1, 2, 3]);// => false Copy
isPlainObject([1, 2, 3]);// => false
isPlainObject({ 'x': 0, 'y': 0 });// => true Copy
isPlainObject({ 'x': 0, 'y': 0 });// => true
isPlainObject(Object.create(null));// => true Copy
isPlainObject(Object.create(null));// => true
Checks if
value
is a plain object, that is, an object created by theObject
constructor or one with a[[Prototype]]
ofnull
.