Checks and returns true if value is a POJSO Object (Plain Old JS Object), such as object literal {} or object created by Object.create() etc, but NOT instances (eg new MyClass()).
Unlike z.isRealObject(), it does not return true for instances created by new Xxx or for Array or Function or new String() etc.
Unlike lodash _.isPlainObject(Object.create({})) === false, isPOJSObject() returns true for Object.create({}) and Object.create(null) etc.
Don't even mention typeof or _.isObject() - it returns true for too many things, almost all refs like Array, Function etc!
Checks and returns true if value is a POJSO Object (Plain Old JS Object), such as object literal {} or object created by
Object.create()
etc, but NOT instances (egnew MyClass()
).Unlike
z.isRealObject()
, it does not returntrue
for instances created bynew Xxx
or forArray
orFunction
ornew String()
etc.Unlike lodash
_.isPlainObject(Object.create({})) === false
,isPOJSObject()
returnstrue
forObject.create({})
andObject.create(null)
etc.Don't even mention
typeof
or_.isObject()
- it returns true for too many things, almost all refs likeArray
,Function
etc!See
z.isInstance()
for the instance-only checkz.isRealObject()
for the most useful object check