var proto = Object.getPrototypeOf(obj);
var protoproto = Object.getPrototypeOf(proto);
if (proto === Object.prototype && protoproto === null) {
}
If you create objects with a prototype null, you can get rid of protoprotoand just compare protowith Object.prototypeor null.
, , Object.prototype, , Object.prototype.
:
var proto = Object.getPrototypeOf(obj);
if (proto && Object.getPrototypeOf(proto) === null) {
}