flat-map-deep

v4.17.15arrow_drop_down
v4.17.15
v4.17.11
STATUS
Passing
DOWNLOADS
140
LICENSE
MIT
VISIBILITY
Public
PUBLISHED
5 years ago
SIZE
N/A
This method is like `_.flatMap` except that it recursively flattens the mapped results.
2 contributors
Install flat-map-deep as a package?
Copied
npm i @bit/lodash.lodash.flat-map-deep
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.cloud
Component Example
React
React
Vue
Angular
React Native
Add dependency... help_outline
Just
import
any of the 1 million components
and packages in Bit or NPM to the example.
import Button from '@bit/grommet.grommet.button';
import Lodash from 'lodash';
toggle layout
No preview available
modifieddraft
chevron_left
chevron_right
flatMapDeep (
collection:(Array | Object),
iteratee:Function
) : Array

This method is like flatMap except that it recursively flattens the mapped results.

Example
function duplicate(n) {
  return [[[n, n]]]
}

flatMapDeep([1, 2], duplicate)
// => [1, 1, 2, 2]
Arguments
collection: (Array | Object)

The collection to iterate over.

iteratee: Function

The function invoked per iteration.

Returns
Array

Returns the new flattened array.

Help and resources