flatten

v0.9.6arrow_drop_down
v0.9.6
STATUS
Passing
DOWNLOADS
2
VISIBILITY
Public
PUBLISHED
5 years ago
SIZE
982 B
Returns a new list by pulling every item out of it (and all its sub-arrays) and putting them in a new array, depth-first.
1 contributor
Install flatten as a package?
Copied
npm i @bit/justin-capalbo.ramda.flatten
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
flatten (
list:Array
) : Array

Returns a new list by pulling every item out of it (and all its sub-arrays) and putting them in a new array, depth-first.

Example
R.flatten([1, 2, [3, 4], 5, [6, [7, 8, [9, [10, 11], 12]]]]);
     //=> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
Argument
list: Array

The array to consider.

Returns
Array

The flattened list.

Help and resources