array_intersection

Computes the intersection of arrays.

{% json array_1 %}[1,2,3,4,5]{% endjson %}
{% json array_2 %}[0,3,4,6]{% endjson %}
{% assign ar_intersection = array_1 | array_intersection: array_2 %}

{{ ar_intersection | log }} {% comment %} Logs [3,4] to console {% endcomment %}

Last updated