What does TypeScript’s ‘exactOptionalPropertyTypes’ option change?

TypeScript Professional Medium

TypeScript Professional — Medium

What does TypeScript’s ‘exactOptionalPropertyTypes’ option change?

Key points

  • This option enforces strict type checking for optional properties
  • It helps avoid unintentional assignments of undefined to optional properties
  • It improves code clarity by requiring exact type matches for optional properties

Ready to go further?

Related questions