> 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/collection/flatmapdeep.md).

# \_.flatMapDeep（创建同阶数组）

**语法：**

```javascript
_.flatMapDeep(collection, [iteratee=_.identity])
```

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

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

**描述：**

这个方法类似[`_.flatMap`](https://lodash.com/docs/4.17.10#flatMap)，不同之处在于[`_.flatMapDeep`](https://lodash.com/docs/4.17.10#flatMapDeep)会继续扁平化递归映射的结果。

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

**参数：**

* `collection (Array|Object)`: 一个用来迭代的集合。
* `[iteratee=_.identity] (Array|Function|Object|string)`: 每次迭代调用的函数。

**返回值：**

* `(Array)`: 返回新扁平化数组。

**例子：**

```javascript
function duplicate(n) {
  return [[[n, n]]];
}

_.flatMapDeep([1, 2], duplicate);
// => [1, 1, 2, 2]
```
