Nullable Types

Nullable types allow a variable to be either a type or null/undefined.

Snippet:

let value: string | null = null;

Example:

let name: string | undefined = undefined;