Question · JavaScript and TypeScript course · Module 6: TypeScript Basics
Type Guards
What is a type guard in TypeScript?
Answer options
- A decorator that validates types
- A VS Code plugin that validates types
- A mechanism that protects against variable type changes
- An expression that checks a type at runtime, narrowing the type in a conditional block
You can check the correct answer by solving this task in the CodeWorlds game.