I am learning Javascript and I recently learned a bit about prototypes. My understanding of prototypes is that they are literally objects in memory that each newly created object has a pointer to. When a new object is created, the constructor function used to create that object assigns the prototype of the newly created object to be the prototype of the constructor function. In other words, if I have a Circle constructor function, and I create a new Circle object, that new object and the Circle constructor function both point to the same reference.
My question is: if prototypes are supposed to refer to the "parent" object that created the object, such as a constructor function, why don't constructor functions, which are functions and thus objects, point to "Function" constructor as their prototype? If you try creating a new constructor like so:
function Circle() {}
let c1 = new Circle();
You'll see c1 has the following as its prototype which makes sense, since the Circle constructor created it
Circle {}
__proto__:
constructor: ƒ Circle()
__proto__: Object
and Circle.prototype
is the same object as above. So why doesn't Circle.prototype
point to Function
as a prototype?