Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardTypeScripttype-level string parsingSingle-choice MCQ

With `infer` inside a template literal type, the inferred segment is matched lazily (shortest match first). What does `R` resolve to?

type AfterFirstDot<S extends string> = S extends `${infer Head}.${infer Tail}` ? Tail : S; type R = AfterFirstDot<"2026.06.17">;