TypeScript · Senior · Question 66 of 75

Why can a large union of string literals slow down the compiler?

Explanation

Prefer string with branded or validated types where unions grow into the thousands; check with --extendedDiagnostics.

Further reading

Problem with a question

TypeScript · Senior · question 66

Test yourself

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

Take this quiz