let us create an empty object {} this object does have a constructor object representing the function responsible for creating the empty object and the constructor object does have a prototype object which is responsible for setting the proto for the to be created object this prototype object itself has a constructor property and so on you can go with this as far as you can (constructor > prototype > constructor > prototype > constructor > prototype > …)
the question is how does JavaScript mange all this Infinitely nested objects ?
The constructor property of a constructor.prototype object is not the constructor of the prototype object but the constructor itself.
If I have a class, say A:
class A { }
And then you create an instance of A:
let a = new A();
The constructor property of a will be A. That is to say, A built a.
a.constructor === A
Which also means that:
a.constructor.prototype = A.prototype
// A.prototype = A.prototype
// since A === a.constructor
Now, the constructor of A.prototype is not A.prototype.constructor that would be Object (or rather it could be, you don't need a constructor to create an object really). Because the prototype of A.prototype is actually Object.prototype and the prototype of Object.prototype is null.
The prototype property of any constructor will be the prototype of their constructed objects and it's NOT the prototype of the object it belongs to.
If you keep doing:
a.prototype.constructor.prototype.constructor... you will be doing circles around the constructor prototype and the constructor itself because:
A.prototype.constructor = A