← TypeScript for Beginners

Lesson 1 of 3 · 9 min

Basic types

TypeScript adds type annotations: let age: number = 17. Wrong types fail before the code runs.

string, number and boolean cover most everyday values; arrays look like string[].

Practice

Annotate three variables — a name, a score and a passed flag — with the right types.

Quiz

+50 pts
1. Type errors are caught…
2. An array of text is typed…

Optional resources

Your lesson toolkit

No purchase or partner signup is required to complete this course or earn quiz points.

These are official product links, not active affiliate links. Learnly does not currently earn a commission from them.

TypeScript Playground

Experiment with types and see compiler feedback instantly.

Free browser tool.

Explore tool