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

Why does this directly self-referential type alias fail to compile, while the array form works?

type JsonOk = string | number | boolean | null | JsonOk[] | { [k: string]: JsonOk }; type Loop = Loop | string;