DeepFrontend
Learning Paths
Practice
System Design & DS
Design Studio
Data Structures Curriculum
Real-World Case Studies
Careers
Job Board
Resume Builder
Blog
Sign in
Search
⌘K
Go Pro
Loading compiler resources...
TypeScript Quiz Practice
Active Recall Drill Session
← Exit Session
Question 1 of 1
hard
TypeScript
A developer writes `type Wrap<T> = T extends any ? T[] : never;` intending Wrap<string | number> to produce (string | number)[], but instead gets string[] | number[]. What's the cause?
A
A bug in TypeScript
B
The bare T extends any check DISTRIBUTES over the union before T[] is applied, producing a wrapped array PER union member instead of one array of the whole union
C
T[] syntax is invalid
D
any never distributes
Check Answer