Watch this video to find out about the Delegation Pattern and how to use it in JavaScript. Some JavaScript API functionality uses Inheritance to a base object to gain functionality from the API. Delegation can accomplish the same tasks in most cases without inheritance, and allows developers to decouple their application.
https://github.com/davidfekke/delegat...
https://fek.io/blog/using-the-delegat...