isNotNil es-toolkit
Checks if a value is neither null nor undefined.
Usage
isNotNil(value)
Use isNotNil when you want to check if a value is neither null nor undefined. It's particularly useful for filtering out null or undefined values from arrays.
It can also be used as a type guard in TypeScript.
Parameters
valueT | null | undefinedrequired
The value to check if it's neither null nor undefined.
Returns
Returns true if the value is neither null nor undefined, false otherwise.
Source: es-toolkit
Re-exported verbatim from es-toolkit. Implementation, edge cases, and performance behavior are owned upstream. This page mirrors the documentation at the pinned version; the linked source is authoritative.