> 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/util/topath.md).

# \_.toPath

**语法：**

```javascript
_.toPath(value)
```

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

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

**描述：**

转化`value`为属性路径的数组 。

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

**参数：**

* `value (*)`: 要转换的值

**返回值：**

* `(Array)`: 返回包含属性路径的数组。

**例子：**

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

_.toPath('a[0].b.c');
// => ['a', '0', 'b', 'c']
```
