Skip to content
CodeWiki
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
Search
⌘K
English
English
Chinese
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
English
English
Chinese
Practice
/
Quiz
/
TypeScript
/
Basic types
Why is unknown safer than any for an untrusted JSON result?
from Basic types
TypeScript 6
beginner
1 min
Why is unknown safer than any for an untrusted JSON result?
unknown requires narrowing or validation before type-specific operations.
unknown validates JSON properties automatically at runtime.
unknown converts every primitive into a string.
unknown prevents the JavaScript from being emitted.
Check
Ask AI about this kata
Report an error
previous kata
Spot the bug in firstLabel
Spot the bug
A new version is available
Reload