Skip to main content
Journey Uncommon Logo
JourneyUncommon
easyTypeScriptinterface vs type aliasSingle-choice MCQ

Why does the `type` line fail while the `interface` line compiles?

interface Box { size: number; } interface Box { color: string; } // ok type Bag = { size: number; }; type Bag = { color: string; }; // error