In the following class and inherited class declarations:
class Polygon {};
class Triangle extends Polygon {};
console.log(
Polygon.prototype, Polygon.__proto__,
Triangle.prototype, Triangle.__proto__
);
What is the prototype and __proto__ of a top-level class? And then of a subclass? It seems the only sort of identity I can figure out is that Triangle.__proto__ === Polygon.
prototypeA class's prototype object is instance values to pass on to a new instance of the class.
__proto__From what I can see, this looks like it's always the parent class.