liquidjs
liquidjs copied to clipboard
`case` / `when` array equality
Two arrays with the same elements compare equal with an if
tag and the ==
oprator, but not within a case
/ when
block.
{% assign x = "a,b,c" | split: "," %}
{% assign y = "a,b,c" | split: "," %}
{% case x %}{% when y %}TRUE{% else %}FALSE{% endcase %}
{% if x == y %}TRUE{% else %}FALSE{% endif %}
Shopify/Liquid output
TRUE
TRUE
LiquidJS output
FALSE
TRUE