# Use map + join Instead of String Concatenation

Appending strings in a loop creates many intermediate strings. Use `map` and `join` filters instead.

```liquid
{% comment %} BAD: string concatenation in loop {% endcomment %}
{% assign ids = '' %}
{% for product in collection.products %}
  {% assign ids = ids | append: product.id | append: ',' %}
{% endfor %}

{% comment %} GOOD: map + join — one operation {% endcomment %}
{% assign ids = collection.products | map: 'id' | join: ',' %}
```

Also works for building class lists, data attributes, and comma-separated values.
