# $join

#### Signature

`{{$join array [path] [separator] [final] }}`

#### Arguments

<table><thead><tr><th width="150">Name</th><th width="272.5333333333333">Description</th><th width="150">Type<select multiple><option value="b0403385da1b4af9a8a894cb7cfa1e88" label="String" color="blue"></option><option value="6a3ca9c830be4cd5a2bcf10d17c44f82" label="Number" color="blue"></option><option value="011b91dfe58a400894b04549ec4f9e02" label="Boolean" color="blue"></option><option value="3c1342f6b38a46e39064bd88015df50d" label="Any" color="blue"></option><option value="fe749c5299b341f8a6aaa533ce045b4d" label="String Array" color="blue"></option><option value="525618894ebe442ca9721339fc729e56" label="Number Array" color="blue"></option><option value="d5f34c3a9e6d4a0da0490ee7be091a26" label="Object Array" color="blue"></option><option value="72a2ef6ca94a4272bc70b7acaceec18e" label="" color="blue"></option></select></th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>array</td><td>Accepts either an array of data or a relative <a href="broken-reference">path</a>, as a String, to an array.</td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String, </span><span data-option="fe749c5299b341f8a6aaa533ce045b4d">String Array, </span><span data-option="525618894ebe442ca9721339fc729e56">Number Array, </span><span data-option="d5f34c3a9e6d4a0da0490ee7be091a26">Object Array</span></td><td>true</td></tr><tr><td>path</td><td><p>If the array is a collection (an array of objects) then use this <a href="broken-reference">path</a> to specify which property in the object should be concatenated.</p><p><mark style="color:blue;"><strong>Default value</strong></mark>: ", "</p></td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String</span></td><td>false</td></tr><tr><td>separator</td><td>String that separates each item in the array.</td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String</span></td><td>false</td></tr><tr><td>final</td><td>The string that's used to separate the last two items.</td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String</span></td><td>false</td></tr></tbody></table>

#### Example #1 - Array of strings

{% tabs %}
{% tab title="Template" %}

```handlebars
{{$join categories ", " " & "}}
```

{% endtab %}

{% tab title="Data" %}

```json
{
  "categories": ["Disguise", "Explosive", "Transportation"]
}
```

{% endtab %}

{% tab title="Result" %}
Disguise, Maintenance & Transportation
{% endtab %}
{% endtabs %}

#### Example #2- Collection (array of objects)

{% tabs %}
{% tab title="Template" %}

```handlebars
{{$join items "name" ", " " & "}}
```

{% endtab %}

{% tab title="Data" %}

```json
{
  "items": [
    { "name": "Glue V1", "price": 9.99 },
    { "name": "Artificial Rock", "price": 26.99 },
    { "name": "Bat-Man's Outfit", "price": 159.99 }
  ]
}
```

{% endtab %}

{% tab title="Result" %}
Glue V1, Artificial Rock & Bat-Man's Outfit
{% endtab %}
{% endtabs %}

#### Example #3 - Path to array

{% tabs %}
{% tab title="Template" %}

```handlebars
{{$join "company.employees" "name" ", " " & "}}
```

{% endtab %}

{% tab title="Data" %}

```json
{
  "company": {
    "name": "Acme Co.",
    "employees": [
      {
        "name": "Bernadine Burton",
        "role": "Decoy"
      },
      {
        "name": "Good Battle",
        "role": "Field Agent"
      },
      {
        "name": "Dennis Miles",
        "role": "Field Agent"
      }
    ]
  }
}
```

{% endtab %}

{% tab title="Result" %}
Bernadine Burton, Good Battle & Dennis Miles
{% endtab %}
{% endtabs %}
