TypeScript: Using Types Safely – quiz with 15 questions
Type inference, unknown instead of any, union and literal types, narrowing, generics, utility types, and tsconfig with strict – how the compiler catches errors before runtime.
Questions
15
Level
Intermediate
Area
Programming & data · Programming languages
Modules
Grundtypen & Inferenz
Unions, Interfaces & Generics
Compiler & Praxis
Sample question
Was passiert mit den Typangaben von TypeScript, wenn der Code im Browser läuft?
Sie wurden beim Kompilieren entfernt
Der Browser prüft sie bei jedem Aufruf
Sie werden in JSON-Schemas umgewandelt
Sie verlangsamen das Programm stark
Correct: Sie wurden beim Kompilieren entfernt. TypeScript prüft nur beim Kompilieren, danach bleibt reines JavaScript (Type Erasure). Daten von aussen prüft man zur Laufzeit zusätzlich, etwa mit Zod.
More questions from the quiz
Welchen Typ leitet TypeScript bei const x = [1, 2] ab?
Worin unterscheidet sich unknown von any?
Was bewirkt die Option strict in der tsconfig.json?
Was meldet TypeScript mit strictNullChecks bei let name: string = null?
Was beschreibt type Status = "offen" | "bezahlt" | "storniert"?
The questions and explanations are in German – checked by experts, not machine-translated.
After every answer, Quizbot explains why it is right or wrong. Open questions come first, and progress is counted per topic. The quiz is free of charge; no account is needed.