Why does a new object show [[Prototype]]: Object instead of null when expanding in Chrome console? [duplicate]

1 day ago 1
ARTICLE AD BOX

I’m trying to understand how Chrome DevTools is showing the prototype of a plain object.

const obj = {};

console.dir(obj);

When I expand the logged object:

Expand Object

Expand [[Prototype]]

I see:

__proto__: Object

My question: Why is __proto__ shown as Object and not null?

If I expand that __proto__, I see all the properties from Object.prototype.
This feels odd to me, because expanding the outer Object already shows Object.prototype, so I’m not sure why both levels display similar content.

But if I run:

Object.getPrototypeOf(obj)

Chrome shows something that looks like:

__proto__: null //which is expected

So I’m trying to figure out:

Why the logged object shows [[Prototype]]: Object, instead of null

It seems like DevTools displays prototypes differently depending on how you inspect them, and I want to understand what’s actually happening.

Read Entire Article