Skip to content

isNullish

Determine if a value is null or undefined

53 bytes

Usage

Pass in a value and get a boolean telling you if the value is null or undefined.

import * as
import _
_
from 'radashi'
import _
_
.
function isNullish(value: unknown): value is null | undefined
export isNullish

Return true if the given value is null or undefined.

@seehttps://radashi.js.org/reference/typed/isNullish

@example

isNullish(null) // => true
isNullish(undefined) // => true
isNullish('') // => false
isNullish(0) // => false

@version12.3.0

isNullish
(null) // => true
import _
_
.
function isNullish(value: unknown): value is null | undefined
export isNullish

Return true if the given value is null or undefined.

@seehttps://radashi.js.org/reference/typed/isNullish

@example

isNullish(null) // => true
isNullish(undefined) // => true
isNullish('') // => false
isNullish(0) // => false

@version12.3.0

isNullish
(
var undefined
undefined
) // => true
import _
_
.
function isNullish(value: unknown): value is null | undefined
export isNullish

Return true if the given value is null or undefined.

@seehttps://radashi.js.org/reference/typed/isNullish

@example

isNullish(null) // => true
isNullish(undefined) // => true
isNullish('') // => false
isNullish(0) // => false

@version12.3.0

isNullish
('') // => false
import _
_
.
function isNullish(value: unknown): value is null | undefined
export isNullish

Return true if the given value is null or undefined.

@seehttps://radashi.js.org/reference/typed/isNullish

@example

isNullish(null) // => true
isNullish(undefined) // => true
isNullish('') // => false
isNullish(0) // => false

@version12.3.0

isNullish
([]) // => false
import _
_
.
function isNullish(value: unknown): value is null | undefined
export isNullish

Return true if the given value is null or undefined.

@seehttps://radashi.js.org/reference/typed/isNullish

@example

isNullish(null) // => true
isNullish(undefined) // => true
isNullish('') // => false
isNullish(0) // => false

@version12.3.0

isNullish
(0) // => false