TypeScript · Lesson 93 of 120
Patterns Quiz
Test yourself.
Let's review the patterns. Pause after each question, and answer before I do.

- Patterns quiz
- Pause and think
- Then check
Question 1
What does satisfies do? Checks a value, but keeps its exact type.
Quick check
satisfies:
Question 2
What stops two kinds of number ID from mixing? Branded types.
Quick check
Order and customer ids can't mix with:
Question 3
Which method is blocked on a readonly array? Sort.
Quick check
On readonly number[], this is an error:
Question 4
When should you return a result instead of throwing? For expected failures.
Quick check
Use a Result type for:
Summary
Well done. Next, testing with types.
Key takeaways- satisfies
- Brands
- Result
Next up: Testing with Types — expect errors