Skip to content

isNil() function

Checks if the given value is null or undefined.

Signature:

typescript
isNil: <T>(input: T) => input is T & (null | undefined)

Example

ts
isNil(1); // false
isNil('1'); // false
isNil(undefined); // true
isNil(null); // true

Open Source Code

Released under the Apache-2.0 License.