flatMapDeep
_.flatMapDeep(iteratee, collection)
# Ⓢ [Ⓣ][1] Ⓝ
This method is like _.flatMap except that it recursively flattens the
mapped results.
Since
4.7.0
Arguments
iteratee(Function): The function invoked per iteration.collection(Array|Object): The collection to iterate over.
Returns
(Array): Returns the new flattened array.
Example
function duplicate(n) {
return [[[n, n]]];
}
_.flatMapDeep(duplicate, [1, 2]);
// => [1, 1, 2, 2]