# Decorator in JavaScript and Typescript * In JavaScript, we can apply decorators to class fields, methods, and the entire class. Therefore, we can’t use decorators on plain objects. They only work with classes. * Decorators are not a standard JavaScript feature. They are in stage 3 of the ECMA TC39 specification phase. To use JavaScript Decorators we need to set up a transpiler tool in our development environment, like Babel. * Decorator is concept and can be in form of function or start with `@`. There are function decorator and class and it's member decorator. Fot indepenedent/global function we can decorate it by wrapping it inside another function but for class decorator we can use the `@` symbol and typescript or bable library. # References * https://medium.com/@victortoschi/using-decorators-in-javascript-e80674e4c6fa * https://www.sitepoint.com/javascript-decorators-what-they-are/ * https://www.typescriptlang.org/docs/handbook/decorators.html https://medium.com/codelit/functional-programming-in-javascript-decorators-43eef1c49cf3