Put in order · JavaScript and TypeScript course · Module 6: TypeScript Basics
Type Checking Methods
Order type checking methods in TypeScript from simplest to most advanced:
Items to put in order
- instanceof - checking class instances
- typeof - checking primitive types
- in operator - checking property existence
- Custom type guard (is) - custom type checking function
You can check the correct answer by solving this task in the CodeWorlds game.