How to decouple methods from classes in JavaScript
Very cool, thanks for sharing about how Object.assign()
can be useful when working with objects in JavaScript Aphinya!!!
I thought the following example was very clear:
Keep up the great work writing about JavaScript Aphinya Dechalert!!!
Thanks to Christopher Jeffery for pointing out that Object.assign does not use prototypal inheritance; it instead applies the property/method directly to the instance of the object.