Function isUndefinedOrEmpty

  • Determines whether the provided object is undefined or empty.

    This function checks if the provided object is undefined, an empty string or an empty array. It is used to validate if the object has a value or contains elements.

    Parameters

    • object: unknown

      The object to be checked. It can be of any type but is expected to be a string or an array.

    Returns boolean

    true if the object is undefined, an empty string, or an empty array, otherwise false.

    Example

    // Returns: true
    ix.api.is.isUndefinedOrEmpty(undefined);
    ix.api.is.isUndefinedOrEmpty("");
    ix.api.is.isUndefinedOrEmpty([]);

    // Returns: false
    ix.api.is.isUndefinedOrEmpty("Hello, World!");
    ix.api.is.isUndefinedOrEmpty([1, 2, 3]);