Making Object Literals a sub-class of Object

Bergi a.d.bergi at web.de
Fri Oct 14 13:32:11 UTC 2016


I wrote:
> Brian Ninni wrote:
>
>> On more than one occasion I've had to determine whether something was a
>> plain old Object, or some other class. This involves checking that the
>> given object was NOT an instanceof any other acceptable class.
>
> `Object.prototype.isPrototypeOf(o)` should do that (if you don't care
> about other realms).

Ooops, `Object.getPrototypeOf(o) === Object.prototype` is what I meant.

- Bergi



More information about the es-discuss mailing list