# $cart->join()

> Joins the collection elements into a string, optionally using a Closure to transform the elements

- Source: `src/Toolkit/Collection.php#L680` <https://github.com/getkirby/kirby/blob/6.0.0-beta.1/src/Toolkit/Collection.php#L680>
- Inherited from Kirby, not part of the Merx API. See <https://getkirby.com/docs/reference>.

```php
$cart->join(string $separator = ', ', null|Closure $as = null): string
```

## Parameters

| Name | Type | Default |
| --- | --- | --- |
| `$separator` | `string` | `', '` |
| `$as` | `null\|Closure` | `null` |

## Return type

`string`

## Parent class

`Wagnerwagner\Merx\Cart` inherited from `Kirby\Toolkit\Collection`
