---
title: "Objects and Comparisons"
slug: "objects-comparisons"
updated: 2025-11-14T21:23:07Z
published: 2025-11-14T21:23:07Z
---

> ## Documentation Index
> Fetch the complete documentation index at: https://knowledge.technolutions.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Objects and Comparisons

In [Liquid markup](/v1/docs/getting-started-with-liquid-markup), the fundamental unit we work with is the **object**.

## Objects

Say you’re in a Slate location that provides access to merge fields, like the *Edit Message*interface in a Deliver mailing.

When you select a merge field, it is inserted at the position of your cursor as a Liquid object. For example, with the *Recipient* field selected, if you then select the *Email* merge field, the Liquid object `{{Email}}` appears at the location of the cursor.

When the mailing is sent, these placeholder Liquid objects are replaced with the data values they represent: `{{Email}}` becomes `alexander.hamilton@slate.edu`, `{{First}}` becomes `Alexander`, and so on.

Referencing a merge field value wrapped in curly brace delimiters `{{ }}` **outputs**the value represented by the merge field inside those delimiters.

## Operators

Now that we know how to output values with Liquid, we can start to add tags that define the conditions under which they should appear. You can define these conditions with **operators**.

Operators work in conjunction with the conditional tags:

- 📖 [The If, Elsif, and Else tags](/v1/docs/if-else-elsif-tags)
- 📖 [The Unless Tag](/v1/docs/unless-tags-in-liquid-markup)
- 📖 [The Case Tag](/v1/docs/case-tags-in-liquid-markup)

### Comparison operators

#### `==`

Evaluates as *True*if one value is equal to another value:

```plaintext
{% if {{major}} == 'Philosophy' %}
    Existentialism? Don't get us started!
{% endif %}
```

#### `!=`

Evaluates as *True*if one value is not equal to another value:

```plaintext
{% if {{major}} != 'Statistics' %}
    Probability is overrated!
{% endif %}
```

#### `&gt;=`

Evaluates as *True*if the value on the left is greater than or equal to the value on the right:

```plaintext
{% if {{guests}} >= 10 %}
    Groups of 10 or more will need to ride in separate golf carts.
{% endif %}
```

#### `&gt;`

Evaluates as *True*if the value on the left is greater than the value on the right:

```plaintext
{% if {{guests}} > 10 %}
    Groups of more than 10 will need to ride in separate golf carts.
{% endif %}
```

#### `&lt;`

Evaluates as *True*if the value on the left is less than the value on the right:

```plaintext
{% if {{guests}} < 10 %}
    Groups of less than 10 will ride in the same golf cart.
{% endif %}
```

#### `&lt;=`

Evaluates as *True*if the value on the left is less than or equal to the value on the right:

```plaintext
{% if {{guests}} <= 9 %}
    Groups of nine or less will ride in the same golf cart.
{% endif %}
```

#### `contains`

Evaluates as *True*if the value on the left contains the value on the right:

```plaintext
{% if {{major}} contains 'Science' %}
    Let us tell you more about the seduction of scientific deduction!
{% endif %}
```

### Boolean operators

Multiple comparisons can be made in the same evaluation using the `and` & `or` Boolean operators:

#### `and`

Evaluates as *True*if both expressions evaluate as *True*:

```plaintext
{% if {{major}} == 'Philosophy' and {{degree}} == 'Doctorate' %}
    So we take it you're serious about Philosophy?
{% endif %}
```

#### `or`

Evaluates as *True*if at least one expression evaluates as *True*:

```plaintext
{% if {{major}} == 'Philosophy' or {{major}} == 'Political Science' %}
    Debate is in your future
{% endif %}
```

> [!WARNING]
> 📝 Note
> 
> Boolean expressions are always evaluated from [right to left](https://shopify.dev/docs/api/liquid/basics#order-of-operations) in Liquid.

#### Truthiness and falsiness

When you work with Boolean operators in Liquid, it’s worth understanding the conditions under which an expression will evaluate as *True*and when it will evaluate as *False*. For example, an empty string will evaluate in a comparison as *True*, meaning empty strings are **truthy**values.

📖 [Truthy and falsy in Liquid](https://shopify.dev/docs/api/liquid/basics#truthy-and-falsy)
