Inheritance

In notebook:
FrontEndMasters Advanced JavaScript
Created at:
2016-10-07
Updated:
2016-10-07
Tags:
Fundamentals JavaScript
Classical inheritance:diagramThese are copies

The metaphor of blueprints. The builder is copying the characteristics from the blueprint to the building. One the building is done there's no physical relationship between the building and the blueprint.

Inheritance means copy!
In JavaScript there's no copy, so the word inheritance is not correct either. 

Some people like to use the term "prototypal inheritance". It's still untrue and incorrect.
Instead in JavaScript we have delegation links.
Note the arrows going the other direction:
diagramFor 20 years people we trying to turn this around make it work like classes. Like mixin-pattern etc. All of them are attempts to do the opposite of how JavaScript object delegation works.

Behaviour Delegation

JavaScript has behaviour delegation.