Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardTypeScriptinference internalsSingle-choice MCQ

Inference from a contextually-typed callback uses lower priority than inference from a plain argument, so the plain argument fixes the type variable first. What is the inferred element type of `out`?

declare function mapBack<T>(seed: T, fn: (acc: T) => T): T[]; const out = mapBack(1 as const, (acc) => acc);