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

The two assignments below target the same type `P`. One triggers an excess-property error and one does not. What is the underlying reason?

type P = { a: number }; const base = { a: 1, b: 2 }; const p: P = { ...base }; // (1) const p2: P = { ...base, c: 3 }; // (2)