Skip to Content
TypeScript for Beginners: Catch Wrong Data Before It Runs
Beginner
0 likes
Courses
TypeScript for Beginners: Catch Wrong Data Before It Runs

Check Yourself: Shapes You Can Reuse

Five scenario questions on type aliases, merging, literal widening and narrowing. If you miss more than one, reread the lessons in this section.

Course content

Sign in to save your progress.

Course Home
3. You declare const order = { status: "paid" }; and call label(order.status) where label accepts a union of the words draft, sent and paid. The call fails. Why?
4. A union has two object types that both have a name property and differ in other keys. You write if ("name" in person) and then read person.id. Why does the compiler refuse?

About

Five scenario questions on type aliases, merging, literal widening and narrowing. If you miss more than one, reread the lessons in this section.

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

Comments (0)

Sign in to comment

No comments yet.