Determines if an array is not empty.
The type inferred for the array is ReadonlyArray<T>, but the type returned is NonEmptyArray<T>.
ReadonlyArray<T>
NonEmptyArray<T>
NonEmptyArray
isNonEmptyArray([1, 2, 3]); // => trueisNonEmptyArray([]); // => false Copy
isNonEmptyArray([1, 2, 3]); // => trueisNonEmptyArray([]); // => false
The type of the items in the array to check.
The array to check.
True if the array is not empty, false otherwise.
Determines if an array is not empty.
The type inferred for the array is
ReadonlyArray<T>
, but the type returned isNonEmptyArray<T>
.See
NonEmptyArray
Example