# Operators

> The logical and comparison operators Liquid supports in conditional tags, including how contains works and the left-to-right order in which operators are evaluated.

## Logical and comparison operators

Liquid supports basic logical and comparison operators for use with [conditional tags](../tags/conditional).

| Operator   | Function                                |
| ---------- | --------------------------------------- |
| `==`       | equals                                  |
| `!=`       | does not equals                         |
| `>`        | greater than                            |
| `<`        | less than                               |
| `>=`       | greater than or equal to                |
| `<=`       | less than or equal to                   |
| `or`       | Condition A or Condition B              |
| `and`      | Condition A and Condition B             |
| `contains` | Checks for strings in strings or arrays |

### contains

You can use `contains` to check for the presence of a string within an array, or another string. You can’t use `contains` to check for an object in an array of objects.

```liquid title="Code"
{% if product.tags contains 'hot' %}
  This potion contains hot properties.
{% endif %}
```
```json title="Data"
{
  "product": {
    "tags": [
      "hot"
    ]
  }
}
```

```html title="Output"
This potion contains hot properties.
```

### Order of operations

When using more than one operator in a tag, the operators are evaluated from left to right, and you can’t change this order.

:::warning
Parentheses `()` aren’t valid characters within Liquid tags. If you try to include them to group operators, then your tag won’t be rendered.
:::

```liquid title="Code"
{% unless true and false and false or true %}
  This evaluates to true, since Liquid checks tags like this:
	
  ((true and false) and false) or true
  (false and false) or true
  false or true
  true
{% endunless %}
```

```html title="Output"
<!-- empty -->
```
