Why you should choose composition over inheritance | Javascript OOP Tutorial

Web Dev Roadmap for Beginners (Free!): https://bit.ly/DaveGrayWebDevRoadmap Why you should choose composition over inheritance when you are creating objects. This tutorial will look at both approaches to creating objects and show you why composition is the best choice as well as the problems that arise with inheritance. 🚩 Subscribe ➜ https://bit.ly/3nGHmNn 🚀 JavaScript for Beginners: Full Course (8 hours):    • JavaScript Full Course for Beginners | Com...   Advanced Javascript Tutorials mentioned in this video: 🔗 Javascript Classes Tutorial:    • Javascript Classes Explained | Javascript ...   🔗 Javascript Prototypes Tutorial:    • What is __proto__ ? | Javascript Prototype...   🔗 Pure FunctionsTutorial:    • What are Pure Functions? | Javascript Func...   🔗 Shallow Copy vs Deep Copy Tutorial:    • Shallow Copy and Deep Copy | Advanced Java...   🔗 Decorator Functions Tutorial:    • Video   🔗 Currying Functions Tutorial:    • How to Curry Functions | An Advanced Javas...   🔗 Source Code: https://gist.github.com/gitdagray/e34... Why you should choose composition over inheritance | Javascript OOP Tutorial (00:00) Intro (0:18) Problems with object inheritance (4:45) Composition to the rescue (10:41) Data structure mutation (12:51) Cloning to avoid mutation (16:15) Bonus: Refactoring to a declarative expression (17:49) Review of Composition ✅ Follow Me: Twitter:   / yesdavidgray   LinkedIn:   / davidagray   Blog: https://yesdavidgray.com Reddit:   / daveoneleven   Was this tutorial about choosing Javascript object composition over inheritance helpful? If so, please share. Let me know your thoughts in the comments. #composition #inheritance #javascript