Mixins
introduction to inheritance and the importance of mixins in JS; and cloning objects in ES6
We'll cover the following...
Heated debates of composition over inheritance made mixins appear to be the winner construct for composing objects. Therefore, libraries such as UnderscoreJs and LoDash created support for this construct with their methods _.extend
or _.mixin
.
In ES6, Object.assign
does the same thing as _.extend
or _.mixin
. ...