Skip to content

EasyConceptTypeScript in depth

What does the unknown type do compared with any?

What a good answer covers

any turns off type checking, while unknown accepts any value but forces you to narrow it before use. Prefer unknown for untrusted input.

More on TypeScript in depth

Flashcards for this topic