Handlebars Helper Function: equals

Compares two values for equality. It can perform different types of comparisons based on an optional third parameter.

Availability

This helper is available in the Winter ’26 release of Marketing Cloud Next.

Syntax

{{equals value1 value2 compareAs}}

Parameters

Parameter Type Description
value1 Any The first value to compare.
value2 Any The second value to compare.
compareAs String The type of comparison to perform. Possible values: date, datetime, number, string. The default value is string.

Return Value

The function returns true if the values are equal based on the specified comparison type, and false otherwise. If both values are null, it returns true. If no parameters are provided, it returns true. If one parameter is missing, it returns false. If you don’t specify a comparison type, the function performs a string comparison.