LiquidJS operators are very simple and different. There’re 2 types of operators supported:
Comparison operators: ==, !=, >, <, >=, <=
-
Logic operators: or, and, contains
+
Logic operators: not, or, and, contains
Thus numerical operators are not supported and you cannot even plus two numbers like this {{a + b}}, instead we need a filter {{ a | plus: b}}. Actually + is a valid variable name in LiquidJS.
Precedence
-
Comparison operators. All comparison operations have the same precedence and higher than logic operators.
-
Logic operators. All logic operators have the same precedence.
+
Comparison operators, and contains. All comparison operators alongside contains have the same (highest) precedence.
+
not operator. It has slightly more precedence than or and and.
+
or and and operators. These logic operators have the same (lowest) precedence.
-
Associativity
Logic operators are evaluated from right to left, see shopify docs.
+
Associativity
Logic operators are evaluated from right to left, see shopify docs.