Checks if value is a plain object, that is, an object created by the Object constructor or one with a [[Prototype]] of null and has no own enumerable string-keyed properties.
value
Object
[[Prototype]]
null
The value to check.
Returns true if value is an empty plain object, else false.
true
false
isEmptyPlainObject({})// => trueisEmptyPlainObject({ a: 1, b: 2, c: 3 })// => false Copy
isEmptyPlainObject({})// => trueisEmptyPlainObject({ a: 1, b: 2, c: 3 })// => false
Checks if
value
is a plain object, that is, an object created by theObject
constructor or one with a[[Prototype]]
ofnull
and has no own enumerable string-keyed properties.