Handlebar Helper Function: isempty

Checks if a specified parameter evaluates to null or empty. It returns true if the parameter is null, undefined, or an empty string, and false otherwise.

ParameterTypeDescription
inputanyThe value to check for null or empty.

The function returns true if the specified parameter is null, undefined, or an empty string. It returns false for all other values including zero values, non-empty strings, boolean values, and non-empty objects and arrays. If the input parameter is missing, or if the parameter references a non-existent variable, it returns true.

This function is often used together with conditional helpers to handle empty values. For example, this code example checks if the firstName variable is empty and handles it accordingly.