Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

case / when array equality #673

Closed
jg-rp opened this issue Feb 17, 2024 · 0 comments
Closed

case / when array equality #673

jg-rp opened this issue Feb 17, 2024 · 0 comments
Labels

Comments

@jg-rp
Copy link
Contributor

jg-rp commented Feb 17, 2024

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants