TypeScript · Junior · Question 60 of 75
What does Record<'draft' | 'published', number> require?
- ✓Correct answer: An object that has both keys
draftandpublished, each with a number - 2An object with any string keys
- 3At least one of the keys
Explanation
With a union of literal keys, Record guarantees that no case is forgotten - adding a new status shows errors where it's missing.