JavaScript

A minimal guide to JavaScript (ECMAScript) Decorators and Property Descriptor of the Object

A short introduction of ECMAScript “decorators” proposal with basic examples and a little bit about the ECMAScript ecosystem.

Uday Hiwarale
Published in
13 min readJun 9, 2018

--

⚠️ This article has been revised recently due to the change in the ECMAScript decorators proposal. You can read the earlier version of this article from here.

Why ECMAScript Decorators instead of JavaScript Decorators in the title? Because ECMAScript is a standard for writing scripting languages like JavaScript. It doesn’t enforce JavaScript to support all the specs but a JavaScript engine (implemented inside a browser) may or may not support a feature introduced in ECMAScript or support with little different behavior.

Consider ECMAScript as a language that you speak such as English. Then JavaScript would be a dialect like British English. A dialect is a language in itself but it is based on principals of the language it was derived from. So, ECMAScript is a cookbook for cooking/writing JavaScript and it’s up to the chef/developer to follow all ingredients/rules or not.

Generally, JavaScript adopters (such as web browsers or server-side platforms such as Node.js)…

--

--