I design .

I'm Ketan ‐ A Melbourne web designer, developer and illustrator with 20 years industry experience.

Removing null values from an array in liquid

20 October 2019shopify 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 %}