JavaScript Decorators: What They Are and When to Use Them

0
3
views

With the introduction of ES2015+, and as transpilation has become commonplace, many of you will have come across newer language features, either in real code or tutorials. One of these features that often has people scratching their heads when they first come across them are JavaScript decorators. Editor’s Note: This article has been updated in response to reader comments to remove the incorrect claim that decorators were part of the forthcoming ES2017 standard. Decorators have become popular thanks to their use in Angular 2+. In Angular, decorators are available thanks to TypeScript, but in JavaScript they are currently a stage…
JavaScript Decorators: What They Are and When to Use Them