Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumTypeScriptinferSingle-choice MCQ

What is the type of T given this 'infer extends' clause (TS 4.7+)?

type FirstNumberLiteral<A> = A extends [infer H extends number, ...any[]] ? H : "none"; type T = FirstNumberLiteral<["42", 1, 2]>;