Black Tower Summoning: Object Composition With Mixins
The Mastering the Arcane Art of JavaScript-mancy series are my humble attempt at bringing my love for JavaScript to all other C# developers that haven’t yet discovered how awesome this language and its whole ecosystem are. These articles are excerpts of the super duper awesome JavaScript-Mancy book a compendium of all things JavaScript for C# developers.
In the previous articles of this series you have dived into Object Oriented Programming in JavaScript. You’ve learned about object initializers, factory functions, about constructor functions, prototypical inheritance, polymorphism, how to mimick C# classes with ES5 and even about ES6 classes.
So far we’ve kept ourselves very close to techniques and concepts that you are accustomed to in C# so as to make you a comfortable inhabitant of the world of JavaScript. So! Now that you are almost a mighty JavaScript-mancer we’re going to let go of C# for a little while and embrace the dynamic nature of JavaScript. Welcome to a world of flexibility and freedom! The realm of object composition!
This time by the hand of Mixins.