

Lesson 01 · 8 min
What changes if you know JS
TypeScript is JavaScript plus a contract. At runtime there are no types.
8 minLesson 1 of 10Practice includedAsk AI on any point
You already write JS. TypeScript isn't new semantics or a different runtime. It's a layer of checking before you run: the compiler reads annotations, complains about mismatches and throws the types away. The browser gets ordinary JavaScript. The same is said briefly in TypeScript in 5 minutes — worth keeping open alongside.
That's why typeof user in the console will never answer User: at runtime it's an ordinary object. The typeof operator in JavaScript looks at the value, not at the annotation. If you need to validate data, write the check yourself or use zod. TS doesn't do that.
A typo in JS is a surprise in production. In TS it's a red squiggly line.
Then why write types
- Autocomplete knows the object's shape instead of guessing.
- Refactoring: rename a field and the compiler shows every place.
- A contract between functions, and between you and the API.
- Documentation that doesn't lie, because it's checked.
The extension is .ts / .tsx. You build with tsc, Vite, Next — doesn't matter. What matters: turn on strict mode (strict: true) right away. It enables several flags at once: noImplicitAny, strictNullChecks and others — the list is in tsconfig: strict. Without it the compiler lets null through where you expect a string, and the point of TS disappears.
- TypeScript in 5 minutes: how TS builds on top of JS
- The Basics: what the compiler checks and what it throws away
- tsconfig · strict: which checks one flag turns on
Check
Lock it in before you move on
1. What remains in JS after compiling
const n: number = 1?2. Can you check at runtime that a value has the type
User?