Type guard to check if a value is defined (not null or undefined). Returns a boolean indicating whether the value is defined with "is" for type narrowing.
Describes the type of the value if the value is defined
The value to check
True if the value is defined (not null or undefined); otherwise, false
// Return trueisDefined(5); // trueisDefined("hello"); // true// Return falseisDefined(null); // falseisDefined(undefined); // false Copy
// Return trueisDefined(5); // trueisDefined("hello"); // true// Return falseisDefined(null); // falseisDefined(undefined); // false
Type guard to check if a value is defined (not null or undefined). Returns a boolean indicating whether the value is defined with "is" for type narrowing.