collectype

collectype v0.11.0


collectype / utils/primitives/null / hasNull

Function: hasNull()

hasNull<T>(…args): boolean

Defined in: utils/primitives/null.ts:13

Returns true if any of the provided arguments is null. Useful for quickly checking the presence of null values in a list.

Type Parameters

T

T = unknown

The argument type (inferred)

Parameters

args

T[]

List of values to check

Returns

boolean

True if at least one argument is null, false otherwise

Example

hasNull(1, null, 3); // true
hasNull('a', 'b', 'c'); // false