Return whether a value is exactly undefined or null.
undefined
null
Usage:
import { isNullish } from "mazey";const ret1 = isNullish(undefined);const ret2 = isNullish(null);const ret3 = isNullish("abc");console.log(ret1, ret2, ret3); Copy
import { isNullish } from "mazey";const ret1 = isNullish(undefined);const ret2 = isNullish(null);const ret3 = isNullish("abc");console.log(ret1, ret2, ret3);
Output:
true true false Copy
true true false
Other falsy values, including false, 0, NaN, and an empty string, return false.
false
0
NaN
The value to verify.
Whether the value is undefined or null.
Return whether a value is exactly
undefinedornull.Usage:
Output:
Other falsy values, including
false,0,NaN, and an empty string, returnfalse.