Decorator
Add responsibilities to objects dynamically.
Decorator pattern allows to add a new functionality to the existing object without altering their structure and it acts as a wrapper to the existing class.
This pattern dynamically changes the functionality of the object at runtime without impacting the existing functionality of the object.
In short, it adds the additional functionality to the object by wrapping it.
Decorator is an object that adds feature to another object.
Most frequently used in JavaScript.
Last updated
Was this helpful?