Skip to main content
InterviewHubPRO
Section Overview
Q44

Question 44 of 50

Part 3: Enterprise Architecture, Compiler Internals & Performance (Senior / Staff)

88%
TypeScript Master (50 Qs)•Part 3: Enterprise Architecture, Compiler Internals & Performance (Senior / Staff)

What is `exactOptionalPropertyTypes`?

senior LevelFormsPerformanceSystem Design

In Simple Words: By default with strict: true, an optional property foo?: string allows assigning foo = undefined. Enabling "exactOptionalPropertyTypes": true enforces that an optional property must either be present with the exact type (foo: "hello") or completely omitted ({}), but never explicitly assigned undefined.