Skip to Content
ArrayisNullOrEmptyArray

isNullOrEmptyArray

Checks whether the given value is null, undefined or empty array.

Import

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

Signature

function isNullOrEmptyArray<T extends any[]>(arr: Nullable<T | []>): arr is Nullable<[]> {}

Examples

isNullOrEmptyArray(null) // true isNullOrEmptyArray(undefined) // true isNullOrEmptyArray([]) // true isNullOrEmptyArray([0]) // false isNullOrEmptyArray([,]) // false isNullOrEmptyArray([null]) // false isNullOrEmptyArray([undefined]) // false
Last updated on