Software Development

Inheritance in Object-oriented JavaScript

Inheritance in JavaScript is called prototypal inheritance. Objects inherit from objects. When we create an object from a class,


it always inherits from

In Java speak, this is like saying  “any class inherits from Object class”.

If we point MyClass.prototype to another object, e.g., new Person(), MyClass objects now inherit from Person object.




You Might Also Like

Leave a Reply

Your email address will not be published. Required fields are marked *