Want a faster signal before interviews? Take the Interview Ready Check →

DAY 0 OF 30

What TypeScript actually is

TypeScript is a superset of JavaScript. It takes the JavaScript language and adds a type system on top: a way of stating what kind of value every variable, parameter and return holds.

You cannot run TypeScript directly. It goes through the TypeScript compiler, which checks your types, reads them, and reports a type error anywhere the values do not match.

Build time is when the compiler runs. It checks for type errors and reports them. It then removes all types, turning your TypeScript into plain JavaScript.

Runtime is the point at which your program is plain JavaScript and runs like a normal JavaScript program.

At build time the compiler checks types and removes them, producing plain JavaScript that runs at runtime with no types left.

Static typing means types are checked before the code runs. TypeScript is statically typed because the compiler does its checking at build time.

Check yourself

What is TypeScript?
What does the TypeScript compiler do at build time?
Is TypeScript dynamically typed or statically typed, and why?