A guide to prototype-based class inheritance in JavaScript

Creating A Logical Hierarchy Of Object Types

Cat and Dog are inherited from Pet which is inherited from Animal.

Before We Start

Under The Hood

How prototype chains are created in JavaScript.

Prototype-based Object Inheritance

Object Constructor Functions

Constructors

Prototype-Based Inheritance

Not All Birds Are Made Alike

Testing The Birds

Using class and extends keywords

Overview

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store