Nullish<T>
Nullish<
T> =T|null|undefined
Represents a value that can be null or undefined.
Type Parametersโ
T: Tโ
The base type.
Sinceโ
1.0.0
Exampleโ
type Settings = {
theme: string;
language: `Nullish<string>`; // string | null | undefined
};
const settings: Settings = {
theme: "dark",
language: null // Valid
};