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

When recursively splitting a string, what does `Split<"a..b", ".">` resolve to, accounting for an empty segment?

type Split<S extends string, D extends string> = S extends `${infer H}${D}${infer T}` ? [H, ...Split<T, D>] : [S]; type R = Split<"a..b", ".">;