Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardTypeScriptvariadic tuple typesSingle-choice MCQ

In the variadic-tuple signature below, why does TypeScript infer `T` as `[number, string]` (a fixed tuple) rather than `(number | string)[]`, and what feature enables that precision?

declare function tail<T extends unknown[]>( arr: readonly [unknown, ...T] ): T; const t = tail([1, "a", true] as const);