Here’s a little trick I learned for removing null or empty values from an array in Shopify’s liquid.
By using the compact option like below, we’ll get a nice filtered array back.
{% assign myarray = some_string | split: ',' | compact %}
20 October 2019 shopify liquid web development
Here’s a little trick I learned for removing null or empty values from an array in Shopify’s liquid.
By using the compact option like below, we’ll get a nice filtered array back.
{% assign myarray = some_string | split: ',' | compact %}