Reading · 8 min

Why types help

You are previewing a free lesson. Enrol to save progress and take quizzes.

Types describe the shape of data. When a function expects a Course and receives undefined, TypeScript tells you before the code ever runs. Types also act as documentation that cannot go out of date.