Aicloud E-Learning

Guided Notes

Introduction to TypeScript

Why add types to JavaScript.

TypeScript is a superset of JavaScript that adds a type system: `let age: number = 36;` tells the compiler exactly what kind of value `age` should hold, and it flags mistakes before the code ever runs.

Every valid JavaScript file is already valid TypeScript (mostly) — TypeScript compiles down to plain JavaScript, so it doesn't run directly; a build step converts it first.

The biggest practical benefit is catching a whole class of bugs (passing the wrong shape of data, typos in property names) at compile time instead of discovering them at runtime, often in production.