Decorator is an object-oriented design pattern that allows adding behavior to existing classes in a dynamic fashion. It is one of the Gang of Four's structural design patterns.

- Wiki
3 articles, 0 books.

We can use the decorator pattern when we just want to give some added responsibility to our base class. This design pattern is a great alternative to a sub‑classing feature for extending functionality with some added advantages.

Decorators are a core concept when developing with Angular 2 and above. There’s also an official TC39 proposal, currently at Stage-2, so expect decorators to become a core language feature soon in JavaScript as well.

ES2018+, a.k.a ESnext, a.k.a ECMA-262 is giving us devs some shiny new toys.