TypeScript any vs unknown vs never: Differences, Type Narrowing, Exhaustive Checks and When to Use Each (Tested Examples)
any turns type checking off, unknown accepts any value but makes you check it before use, and never is the type with no values at all. Here is how each behaves, with real compiler output from TypeScript 7.0, plus exhaustive switch checks and the never[] array trap.