TypeScript Introduction
TypeScript is JavaScript plus a type system. You write .ts files, the compiler checks types and removes them, and plain JavaScript is what runs. Types catch many mistakes before the code ever runs and make editors much smarter.
Example
const greeting: string = "Hello, TypeScript!";
console.log(greeting);Result
Hello, TypeScript!
- Run examples with a TypeScript runner such as Bun, or compile with tsc.
Exercise
Add a type to a variable.
const name string = "Ada";
Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.