I am learning Java Script and I see the examples that were published a few years ago show __proto__
in the chrome developer tool - console while explaining the prototypical inheritance concept.
When I execute the same sample code I don't see __proto__
anymore in my current version of Chrome. I only see [[Prototype]]
.
Questions:
__proto__
?Yes, they are the same. It was reported as a bug and then changed somewhen around April 2021 (Chrome 92), to better align with the spec and follow Firefox devtools' lead.
No, you cannot change it back.
The [[prototype]] syntax reflects that it is an internal slot (also here) exposed only by the debugger, not some normal property. Using __proto__
as an alias causes quite some confusion, because object actually can have a normal property of that name, and there's also the old deprecated Object.prototype.__proto__
getter/setter that did access the [[prototype]].