Courses
TypeScript for Beginners: Catch Wrong Data Before It Runs
Final Check: TypeScript for Beginners
Fifteen scenario questions across the whole course. If you get twelve or more right, you have the TypeScript basics covered.
Course content
Join this Course
Sign in to save your progress.
-
Before You Write Types
-
What TypeScript Adds on Top of JavaScript
-
Install TypeScript and Run Your First .ts File
-
-
-
Types You Cannot Skip
-
Annotating Variables Without Fighting the Compiler
-
Arrays, Objects and Nested Shapes
-
Optional, Readonly and Why any Is a Trap
-
-
-
Functions That State Their Deal
-
Parameter and Return Types
-
Optional and Default Parameters Without Surprises
-
-
-
Shapes You Can Reuse
-
Interfaces vs type Aliases: Pick One and Stick With It
-
Unions, Literals and Narrowing With typeof and in
-
-
-
Compile Without the Mystery
-
tsconfig.json: target, module and strict
-
Reading tsc Errors Without Panicking
-
-
- Final Check: TypeScript for Beginners
1.
Why does the compiled hello.js not contain any type annotations?
2.
You install TypeScript with npm install --save-dev typescript. Typing tsc --version says command not found, but npx tsc --version works. Is something broken?
3.
A variable is declared with let total: number; and no value. Why is the annotation needed here but not in const rate = 0.12;?
4.
What is the safest fix when strict mode reports that null is not assignable to string for a variable you declared as string?
5.
You read an array element with prices[5] on a number array of length three. In the default configuration, what is the type and what is the value at run time?
6.
Which declaration of a property means the key may be left out of the object completely?
7.
A function parameter is typed readonly string[]. Your code calls push on it. What happens?
8.
A function declared to return number reaches the end of one branch without a return statement. What is the benefit of the declared return type?
9.
You have a function with three optional parameters and calls like format(100, undefined, undefined, true). What is the better design?
10.
Your team keeps mixing interface and type aliases for object shapes and arguing about which one to use. What is the most useful decision?
11.
A function takes a string or a number and uses typeof id === "string" in an if. Inside the block you call id.toUpperCase(). After the block you call id.toFixed(2). Why does the second call compile?
12.
You turn on strict in an old project and get hundreds of errors. What is the most practical first step?
13.
In a project with a tsconfig.json, which command compiles everything listed in include?
14.
You renamed app.js to app.ts and now get Cannot find name process. What is the most likely cause and fix?
15.
You see the message Parameter x implicitly has an any type. Which reading is correct?
About
Fifteen scenario questions across the whole course. If you get twelve or more right, you have the TypeScript basics covered.
- Duration
- 15 min
- Last update
- 10/11/2026
Was this helpful?
0
0
Comments (0)
Sign in to commentNo comments yet.