Inheritance vs. Composition in JavaScript
One ‘is’ and the other ‘has’ — but do you know the difference?
Published in
3 min readMar 15, 2020
Composition over Inheritance in object-oriented programming is the principle on which classes achieve polymorphic behavior and code reuse by their Composition rather than Inheritance. Using the Composition pattern, you design your models for what they can do, while using inheritance…