flatMap
Last updated
Was this helpful?
Last updated
Was this helpful?
Was this helpful?
"It is our choices that show what we truly are, far more than our abilities." —@@jk_rowling
本文为 《lodash 源码阅读》 系列文章,后续内容会在 github 中发布,欢迎 star,gitbook 同步更新。
import baseFlatten from './.internal/baseFlatten.js';
import map from './map.js';
/**
* 创建一个扁平化的数组
* 这个数组的值来自collection(集合)中的每一个值经过 iteratee(迭代函数) 处理后返回的结果,并且扁平化合并。
* iteratee 调用三个参数: (value, index|key, collection)。
*
* @since 4.0.0
* @category Collection
* @param {Array|Object} collection 迭代遍历的集合。
* @param {Function} iteratee 每次迭代调用的函数。
*