Type Annotation Syntax
Multiple Choice Easy
Question
Which is the correct syntax for a type annotation?
Hint
TypeScript uses a colon after the variable name to declare its type.
Explanation
TypeScript uses name: type syntax for annotations. So let x: number = 5; tells the compiler that x is a number. The other options are invalid syntax.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.