What is TypeScript, and why does Angular use it?

Angular basics · Freshers

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