What Is TypeScript?
A free lesson from Swipe Coding · TypeScript, level 1 · updated October 2026
By the Swipe team, founded by Colin · how we make lessons
JavaScript never checks whether the values flowing through your code are the kind you expect until the moment that code actually runs. TypeScript is a superset of JavaScript, created by Microsoft, that layers a type system on top of it — so a whole category of mistakes gets caught the moment you save the file, before you ever hit run.
function greet(name: string) {
return "Hello, " + name.toUpperCase();
}
greet(42); // Error: Argument of type 'number' is not assignable to parameter of type 'string'.That's the core idea: TypeScript checks types at compile time — while you're writing the code — instead of at runtime, while it's running on someone's machine. The earlier a bug is caught, the cheaper and less embarrassing it is to fix.
Types also make your editor smarter. Once TypeScript knows a variable's exact shape, it can offer accurate autocomplete, flag typos in property names, and show you exactly what a function expects — all without running a single line of code.
const user = { name: "Ravi", age: 29 };
user.ag; // Editor flags this immediately: Property 'ag' does not exist on type '{ name: string; age: number; }'. Did you mean 'age'?Here's the part that surprises a lot of beginners: browsers and Node.js can't run .ts files directly. TypeScript is compiled — translated — down into plain JavaScript before it ever runs. The type annotations only exist to help you while you write; by the time the code actually runs, they've been stripped away entirely.
TypeScript is a ____ of JavaScript that adds a type system on top of it.
Why does TypeScript catch more bugs than plain JavaScript before the code ever runs?
Browsers can execute .ts files directly, without any compilation step.
Keep your streak going in Swipe Coding
Swipe through every level of TypeScript on your iPhone — with XP, stars, streaks, a personal advisor and the full track beyond these free levels.
Get the Swipe apps →