Checks if value passed is a user class instance, created with new MyClass(), as opposed to Plain/POJSO Objects, i.e an object created as literal {} or by Object.create() or new Object().
Also, all builtins (like new Error() / new Number(1) etc) and those created by native code, even with new Xxx(), are not considered as an isInstance() value (it returns false).
To the contrary, new function PseudoClass(){} is a valid instance, as it's a user-defined pseudo class in JS.
Checks if value passed is a user class instance, created with
new MyClass()
, as opposed to Plain/POJSO Objects, i.e an object created as literal{}
or byObject.create()
ornew Object()
.Also, all builtins (like
new Error()
/new Number(1)
etc) and those created by native code, even withnew Xxx()
, are not considered as anisInstance()
value (it returns false).To the contrary,
new function PseudoClass(){}
is a valid instance, as it's a user-defined pseudo class in JS.See
z.isRealObject()
for the most useful object checkz.isPOJSObject()
for the Plain Old JavaScript Object check