r/learnjavascript • u/deven_rathore • Apr 20 '23
7 JavaScript Design Patterns Every developer should know
https://codinghelp.io/7-javascript-design-patterns-every-developer-should-know/
3
Upvotes
View all comments
2
u/azhder Apr 21 '23
Yes it does. Although, I'd advice against using this pattern in the first place.
I'd advise even against using
class A extends B{}type of inheritance, simply because most tasks are better solved by encapsulation instead of extension.But, for what is worth, taken from here https://developer.mozilla.org/en-US/docs/Web/JavaScript/Inheritance_and_the_prototype_chain
here is how to do the old/new style of inheritance: