What is the `unknown` type in TypeScript?

TypeScript Associate Easy

TypeScript Associate — Easy

What is the `unknown` type in TypeScript?

Key points

  • `unknown` type requires type checking before usage
  • It is stricter than the `any` type
  • You cannot perform operations on an `unknown` variable without narrowing its type first

Ready to go further?

Related questions