Properties
Objects definitions can include any combination of required, optional, defaultable named properties and index signatures.
Required
Optional
:::caution[Optional and default only work within objects!]
Adding a optional
or default
to a Type
doesn't alter its standalone behavior.
Rather, it adds metadata that changes how it works when referenced from an object or tuple.
See an example
Prefer the key-embedded syntax ("optionalKey?":
) where possible.
:::