What is the conceptual difference between class-based and prototype-based object orientation?
Last updated
Class-based OOP (Java, C++, C#) is two-tier: a class blueprint defines structure and behavior, and objects are instances stamped from it.
Prototype-based OOP (JavaScript, Self, Lua) is one-tier: objects inherit directly from other objects, with missing properties looked up along the prototype chain.
JavaScript's
classkeyword is syntactic sugar over prototype delegation.
- https://lock29down.medium.com/oop-in-javascript-prototype-vs-class-31ab797d928f
- https://medium.com/javascript-scene/master-the-javascript-interview-what-s-the-difference-between-class-prototypal-inheritance-e4cd0a7562e9
- https://medium.com/@hak.hakobian/classical-inheritance-and-prototype-inheritance-d631e9cc1b5e
- https://developer.mozilla.org/en-US/docs/Glossary/Prototype-based_programming
- https://dev.to/theonlineaid/javascript-oop-concepts-class-based-vs-prototype-based-5602
- https://dev.to/efkumah/why-javascript-is-a-prototype-based-oop-4b4g
- https://dev.to/devteam/top-7-featured-dev-posts-from-the-past-week-5gdm
- https://dev.to/efkumah