JavaScript: Decorators and the accessor keyword

The brand new ECMAScript Decorators

In this lesson, we will explore the new ECMAScript Decorators syntax and uncover what has changed over the past.

Uday Hiwarale
JsPoint
Published in
41 min readApr 2, 2024

--

About 5 years ago in 2018, I wrote my first article about ECMAScript Decorators. Soon after that in 2020, I had to deprecate it and write a revised article to inform you about the new changes in the ECMAScript Decorators proposal. During this time, the proposal was in Stage 2 which means it was subjected to significant changes and changes it had, oh boy.

💡 If you want to know more about ECMAScript proposal stages, you can visit one of these articles I linked above. You should be able to find a table in the beginning of the article describing ECMAScript proposal stages.

As of February 2024, this proposal sits at Stage 3 which means we are very close to getting a release soon but things can still change based on community feedback. You can find this proposal here and find its in-depth summary written by Dr. Axel Rauschmayer here.

So what we are going to do in this article? Well, we are not going to dig into the past and compare the old syntax with the new version. You can visit the above-mentioned articles for that. In…

--

--