Skip to Content
TypeScript Intermediate: Types That Survive Real Projects
Intermediate
0 likes
Courses
TypeScript Intermediate: Types That Survive Real Projects

Check Yourself: Strictness That Pays Off

Five scenario questions on unknown, caught errors and discriminated unions. If you miss more than one, reread the lessons in this section.

Course content

Sign in to save your progress.

Course Home
3. A response type has three cases tagged by a status property with the values success, error and loading. The error case has code and message. Inside an if that tests status equal to the word error, what can you read on the response?
4. You add a fourth case to the response union, with the status empty. A switch on status ends with a default that passes the response to a function taking never. What happens to the existing code?

About

Five scenario questions on unknown, caught errors and discriminated unions. If you miss more than one, reread the lessons in this section.

Duration
5 min
Last update
10/08/2026
Was this helpful?
​ 0 ​ 0

Comments (0)

Sign in to comment

No comments yet.