/is/nonNullable
stdChecks and asserts the given value is not null or undefined.
Type signature
<T>(val: T) => val is NonNullable<T>
Examples
nonNullable(null);
// ⇒ false
Try in REPL
nonNullable(undefined);
// ⇒ false
Try in REPL
nonNullable(false);
// ⇒ true
Try in REPL
nonNullable({ a: 1 });
// ⇒ true
Try in REPL
Questions
- How to check if a given value is non-nullable?
- How to check if a given value is not null?
- How to check if a given value is not undefined?