Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardTypeScriptexcess property checksSingle-choice MCQ

Both lines assign an object with no overlapping properties to an all-optional ('weak') target type. Why do they fail with DIFFERENT error codes?

type Opts = { a?: number; b?: string }; const fresh: Opts = { c: 1 }; // line 1 const src = { c: 1 }; const aliased: Opts = src; // line 2