isNullish
Checks if a value is null or undefined (nullish).
Available since v2.0.0
Import
Section titled “Import”Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
value | unknown | The value to check |
Returns
Section titled “Returns”value is null | undefined — True if value is null or undefined
Examples
Section titled “Examples”Check for null or undefined
Section titled “Check for null or undefined”Returns true only for null and undefined, not other falsy values.
Guard before accessing properties
Section titled “Guard before accessing properties”Use as a type guard to safely narrow types.
