isNullish

function isNullish(val): val is undefined | null

Returns true if the specified value is null or undefined.

Parameters

ParameterTypeDescription
valunknownVariable to test

Returns

val is undefined | null

Whether the variable is null or undefined.