Skip to main content

Javascript: Prototype-based OOP

Prototype-based OOP

  • Prototype-based programming is a style of OOP when inheritance is implemented via the process of cloning existing objects.
  • In class-based OOP inheritance is built around the "parent-child" relationship between classes.
  • Advantages: Objects and classes can be extended at runtime. eg: js(only 2018). JS Object Oriented Programming language but style: prototype.


Prototype based Inheritance

  • functional constructor(no class) as blueprint properties collection.
  • with properties, we can make multiple instances.





Comments