TypeScript
What is it?
TypeScript is a strongly typed programming language that builds on JavaScript by adding optional static type checking. Developed by Microsoft, it helps catch errors during development rather than at runtime, improves code documentation through type definitions, and enables better tooling with features like intelligent autocompletion and safe refactoring in modern code editors.
Practical example
When defining a function in TypeScript, you specify parameter and return types: function calculateTotal(price: number, quantity: number): number. If you accidentally pass a string, TypeScript shows an error immediately in your editor before you even run the code. Interfaces define object shapes like interface User with id, name, and email properties, ensuring API responses match expected structures throughout your codebase.
Test your knowledge
What does TypeScript add to JavaScript?