optional property

An object property marked with a question mark, such as bio?: string, which may be left out.

In more detail

By default an optional property also accepts an explicit undefined value. exactOptionalPropertyTypes removes that, so the key must be either missing or a real value. Partial makes every property optional; Required removes the question marks.

Related terms

Taught in

References