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 at least one own enumerable string-keyed property.
value
Object
[[Prototype]]
null
The value to check.
Returns true if value is a non-empty plain object, else false.
true
false
isNonEmptyPlainObject({ a: 1, b: 2, c: 3 })// => trueisNonEmptyPlainObject({})// => false Copy
isNonEmptyPlainObject({ a: 1, b: 2, c: 3 })// => trueisNonEmptyPlainObject({})// => false
Checks if
valueis a plain object, that is, an object created by theObjectconstructor or one with a[[Prototype]]ofnulland has at least one own enumerable string-keyed property.