Decorators add behavior to classes or functions in a readable way. They’re commonly used in frameworks like Angular and experimental features for annotating and modifying classes.
Example: In ES6+ environments, decorators can be applied as:
function log(target) {
console.log("Logging:", target);
}
@log
class MyClass {}