Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardTypeScriptpreventing distributionSingle-choice MCQ

Both conditionals look almost identical. What distinguishes `A` from `B` at the type level?

type A<T> = T extends string ? 1 : 2; type B<T> = [T] extends [string] ? 1 : 2; type RA = A<string | number>; type RB = B<string | number>;