Skip to Content
GuardisNull

isNull

Check whether the given value is nullable (undefined or null)

Import

import { isNull } from '@fullstacksjs/toolbox';

Signature

function isNull(x: unknown): x is Nullish {};

Examples

isNull(undefined) // true isNull(null) // true isNull('null') // false isNull(0) // false isNull([]) // false isNull({}) // false isNull(false) // false
Last updated on