_.flatMapDepth(collection, [iteratee=_.identity], [depth=1])
该方法类似_.flatMap
,不同之处在于,_.flatMapDepth
会根据指定的 depth
(递归深度)继续扁平化递归映射结果。
const_=require('lodash'); vararr=_.flatMapDepth([1, 2], function (n) { return [[[n, n]]]; }, 2); console.log(arr)
该方法类似_.flatMap
,不同之处在于,_.flatMapDepth
会根据指定的 depth
(递归深度)继续扁平化递归映射结果。
const_=require('lodash'); vararr=_.flatMapDepth([1, 2], function (n) { return [[[n, n]]]; }, 2); console.log(arr)