# \_.entries -> toPairs

**语法：**

```javascript
_.toPairs(object)
```

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

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

**描述：**

创建一个`object`对象自身可枚举属性的键值对数组。这个数组可以通过[`_.fromPairs`](https://lodash.com/docs/4.17.10#fromPairs).撤回。如果`object`是 map 或 set，返回其条目。

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

**别名：***\\*.entries\_

**参数：**

* `object (Object)`: 要检索的对象。

**返回值：**

* `(Array)`: 返回键值对的数组。

**例子：**

```javascript
function Foo() {
  this.a = 1;
  this.b = 2;
}

Foo.prototype.c = 3;

_.toPairs(new Foo);
// => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
```
