js-util

Home > rc-js-util > arrayIsNotEmpty

arrayIsNotEmpty() function

Returns true if the argument is not null, undefined or empty. Type narrows to TArray where true.

Signature:

export declare function arrayIsNotEmpty<TArray extends ArrayLike<unknown>>(items: TArray | null | undefined): items is TArray;

Parameters

Parameter Type Description
items TArray | null | undefined  

Returns:

items is TArray

true if the argument is a non-zero length array.

Remarks

See arrayIsNotEmpty().