isDefined
Checks if a value is defined (not undefined nor null). This is the inverse of isNullish.
Use as a type-safe filter callback to remove null/undefined from arrays.
Available since v2.0.0
Import
Section titled “Import”Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
value | Maybe<T> | The value to check |
Returns
Section titled “Returns”value is T — True if value is not undefined nor null
Examples
Section titled “Examples”isDefined
Section titled “isDefined”isDefined
Section titled “isDefined”Related Types
Section titled “Related Types”Type for values that can be T, undefined, or null.
