TypeScript · Junior · Question 60 of 75

What does Record<'draft' | 'published', number> require?

Explanation

With a union of literal keys, Record guarantees that no case is forgotten - adding a new status shows errors where it's missing.

Further reading

Problem with a question

TypeScript · Junior · question 60

Test yourself

Take the TypeScript · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz