What is TypeScript, and why does Angular use it?
Model answer
TypeScript is JavaScript with types added. The compiler checks your code before it runs and turns it into plain JavaScript. For example, it warns you if you pass a string where a number is expected.
Angular uses it because types catch mistakes early, give better editor help (autocomplete, safe refactoring) and make large codebases easier to maintain. Decorators, which Angular uses to mark classes as components or services, are also part of TypeScript.
Learn this topic
Angular Tutorial: Beginner to Advanced .
Sign in to add your own answer.
More questions
- What is Angular, and how is it different from AngularJS?
- What is a single-page application (SPA)?
- What does the Angular CLI do? Name some common commands.
- What is a standalone component, and why did Angular move away from NgModules?
- Describe the structure of a basic Angular project.
- What happens when an Angular application starts?