Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardTypeScriptconditional-type distributionSingle-choice MCQ1 views

Why do `Distributive` and `Wrapped` produce different results for the same union input?

type Distributive<T> = T extends any ? T[] : never; type Wrapped<T> = [T] extends [any] ? T[] : never; type D = Distributive<string | number>; type W = Wrapped<string | number>;