array_symmetric_difference
{% assign old_tags = "sale,featured,new" | split: "," %}
{% assign new_tags = "featured,bestseller,clearance" | split: "," %}
{% assign changed_tags = old_tags | array_symmetric_difference: new_tags %}
{% log changed_tags | join: ", " %}sale, new, bestseller, clearanceSyntax
{{ arrayA | array_symmetric_difference: arrayB }}Parameter
Description
Visual Representation
Array A: [1, 2, 3, 4, 5]
Array B: [3, 4, 5, 6, 7]
Result: [1, 2, 6, 7] (elements in A OR B, but NOT both)Examples
Performance
Array A Size
Array B Size
Operations
Notes
Last updated