> For the complete documentation index, see [llms.txt](https://lodash.shujuwajue.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lodash.shujuwajue.com/array/join.md).

# \_.join（转字符串，类php-implode）

**语法：**

```javascript
_.join(array, [separator=','])
```

**源代码链接：**[source](https://github.com/lodash/lodash/blob/4.17.10/lodash.js#L7591)

**npm包链接：**[npm package](https://www.npmjs.com/package/lodash.join)

**描述：**

将`array`中的所有元素转换为由`separator`分隔的字符串。

**开始版本：**&#x34;.0.0

**参数：**

* `array (Array)`: 要转换的数组。
* `[separator=','] (string)`: 分隔元素。&#x20;

**返回值：**

* `(string)`: 返回连接字符串。

**例子：**

```javascript
_.join(['a', 'b', 'c'], '~');
// => 'a~b~c'
```
