← TypeScript learning pathTypeScript · Module 1 of 10
Why TypeScript?
TypeScript adds types to JavaScript so many bugs are caught before running.
📖 Key ideas
- TypeScript is JavaScript plus static types, made by Microsoft.
- Code compiles (transpiles) to plain JavaScript.
- Editors give autocomplete and catch errors as you type.
- Install: npm install -D typescript; compile with npx tsc.
- Every valid JavaScript file is almost valid TypeScript.
💡 Real-life example: TypeScript is a spell-checker for code: it underlines mistakes before you send the letter.
TypeScriptJavaScript with static types
tscTypeScript compiler
Static typingTypes checked before running
.tsTypeScript file extension