TypeScript
TypeScript is JavaScript with static types.
It helps catch mistakes earlier and makes larger codebases easier to maintain.
Mental Model
JavaScript checks most mistakes while the code runs. TypeScript catches many mistakes while you write the code.
function greet(name: string) {
return `Hello, ${name}`
}Learn Next
- primitive types
- arrays and objects
- function types
- interfaces
- union types
- React props types
When It Helps
- functions with clear input/output contracts
- shared data models
- React props
- larger projects where refactoring is risky