Complete Summary of TypeScript 5.0 New Features
1 min read291
TypeScript 5.0 New Features
Let's look at the major features added in TypeScript 5.0.
1. Decorators
Standard decorators are finally introduced.
function logged(target: any, context: ClassMethodDecoratorContext) {
return function (...args: any[]) {
console.log('Method called')
return target.apply(this, args)
}
}
class Example {
@logged
greet() {
return 'Hello!'
}
}
2. const Type Parameters
More accurate type inference is now possible.
3. Performance Improvements
Build speed improved by 10-25%.