Function isNullable

Determines if a value is null or undefined.

isNullable(1); // => false
isNullable(null); // => true
isNullable(undefined); // => true
  • Parameters

    • x: unknown

      The value to check.

    Returns x is undefined | null

    True if the value is null or undefined, false otherwise.