Courses
TypeScript Intermediate: Types That Survive Real Projects
Check Yourself: Classes and Modules in TypeScript
Five scenario questions on access modifiers, hash fields, import type and circular imports. If you miss more than one, reread the lessons in this section.
Course content
Join this Course
Sign in to save your progress.
-
Generics Without the Fog
-
Generic Functions That Keep the Input Type
-
Generic Types for Lists, Results and Caches
-
-
-
Types That Transform Other Types
-
Utility Types: Partial, Pick, Omit and Record
-
Mapped Types You Can Actually Read
-
-
-
Working With Code You Didn't Write
-
@types Packages and When DefinitelyTyped Is Wrong
-
Typing fetch JSON Without Lying to Yourself
-
-
-
Classes and Modules in TypeScript
-
Classes With public, private and protected
-
Modules, Exports and Avoiding Circular Types
-
-
-
Strictness That Pays Off
-
unknown vs any and Safe Parsing
-
Discriminated Unions for API Responses That Vary
-
-
- Final Check: TypeScript Intermediate
1.
A class has a private balance property. After compiling and running, console.log of an instance prints the balance, and JSON.stringify includes it. Why?
2.
The same class is written with a hash prefix on the field name instead of the private keyword. What can outside code do with it?
3.
A constructor is written as constructor with the parameter private readonly limit of type number and an empty body. What does it do?
4.
Two files each import a constant from the other, and the first one reads it while loading. tsc reports no error, but running the program ends with a ReferenceError about accessing a name before initialization. What is the cleanest fix?
5.
With verbatimModuleSyntax turned on, a file imports an Order that is only a type, using a plain named import. The compiler reports an error. What do you write instead?
About
Five scenario questions on access modifiers, hash fields, import type and circular imports. If you miss more than one, reread the lessons in this section.
- Duration
- 5 min
- Last update
- 10/13/2026
Was this helpful?
0
0
Comments (0)
Sign in to commentNo comments yet.