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
The value to check.
Returns true if value is a plain object, else false.
true
false
isPlainObject({ a: 1, b: 2, c: 3 })// => trueisPlainObject(new Date())// => falseisPlainObject(null)// => false Copy
isPlainObject({ a: 1, b: 2, c: 3 })// => trueisPlainObject(new Date())// => falseisPlainObject(null)// => false
Checks if
valueis a plain object, that is, an object created by theObjectconstructor or one with a[[Prototype]]ofnull.