I keep hearing that one of the reasons JavaScript is such a superior language is because it doesn't have classes. Instead, it has this magical thing called Prototypal Inheritance.
Correct me If I'm wrong but from what I understand, Object.prototype
and Object.prototype.constructor
(which runs some native code) are the two fundamental entities in Javascript. How is that different from a class?
What is the need for every function to have a .prototype
if not to have a "blueprint" for object creation when called with the new
operator?