TypeScript tutorialLesson 6Free preview
TS Special Types
This lesson is part of TypeScript · All levels
Summary
TypeScript provides special types such as any, unknown, void, never, and null for specific situations. Any removes type checks, while unknown remains secure because it must be checked before use. The void and never type describes a function with no return value and a value that never appears.
Key points
- Any loosening of the check, unknown requires narrowing
- Void for a function without return value
- Never for a condition that never happened.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.