Type Guards
A type guard is a boolean expression that does a runtime check to guarantee the type in a certain scope.
Built-in Type Guards
typeof
- checks for primitive typesin
- Checks for object propertiesinstanceof
- checks for class instances
A type guard is a boolean expression that does a runtime check to guarantee the type in a certain scope.
Built-in Type Guards
typeof
- checks for primitive typesin
- Checks for object propertiesinstanceof
- checks for class instances