Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardTypeScriptrecursive depth limitsSingle-choice MCQ

Two mutually recursive conditional types count together. Does this resolve, and what governs whether mutual recursion is allowed?

type IsEven<N extends number, C extends any[] = []> = C['length'] extends N ? true : IsOdd<N, [any, ...C]>; type IsOdd<N extends number, C extends any[] = [any]> = C['length'] extends N ? true : IsEven<N, [any, ...C]>; type R = IsEven<6>;