Welcome Guest! (App Version 3.1)

websitnero logo name

Inheritance in JS

Inheritance in JavaScript

JavaScript exhibits inheritance in one and only one way - "Prototypal Inheritance". There is no other way in which inheritance takes place in JavaScript.

This type of inheritance is very different from the 'Classical Inheritance' present in languages like - Java, C++, C#, etc.

Prototypal Inheritance is also - single chain inheritance, multiple-inheritance is not possible via this type of inheritance.

Note: "Most of other prominent languages such as PHP, Python, and Java are class-based languages, which define classes as blueprints for objects and have Classical Inheritance."

Note: "The most famous question is round the corner 'Inheritance in JS' and most common answer is 'via Prototype or Prototypal Inheritance'."

Note: "Unlike most other languages, JavaScript’s object system is based on prototypes, not classes."

Note: "In JavaScript, class inheritance is implemented on top of prototypal inheritance, but that does not mean that it does the same thing:"

We will learn more about Prototypal Inheritance in next chapter.

WebsiteNero is highly optimized for learning various website developing technlogies. We try our best to add maximum modules and examples to help learn the concepts clearly and vividly. We try to present all content and examples as simple as we can removing any complexity to hurdle easy understanding. We try best provide you with worthful content, but we cannot guarantee full correctness of all the content on this site. While using this website, you agree to have read and accepted all our terms of use and conditions, cookie, and privacy policy. Copyright, 2013-2018 by websitenero.com. All Rights Reserved.