Skip to content

isNull ​

The isNull function checks if the provided value is exactly null.

Syntax ​

typescript
isNull(value: any): value is null;

Parameters ​

ParameterTypeDescription
valueanyValue to be checked

Returns ​

TypeDescription
booleanTrue if it is null

Examples ​

typescript
isNull(null); // => true
isNull(undefined); // => false
isNull(0); // => false

Notes ​

  • Useful for explicitly validating null values.

References ​

Released under the MIT License.