flat-map
v1.0.0arrow_drop_downv1.0.0
v0.0.1
STATUS
Passing
DOWNLOADS
29
LICENSE
MIT
VISIBILITY
Public
PUBLISHED
7 years ago
SIZE
501 B
Builds a new collection by applying a function to all elements of
this array and using the elements of the resulting collections.
Like
Install flat-map as a package?
Copied
npm i @bit/bit.utils.array.flat-map
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.cloud
Component Example modifieddraft
React
React
Vue
Angular
React Native
Add dependency... help_outline
Just
and packages in Bit or NPM to the example. any of the 1 million componentstoggle layout
No preview available
chevron_left
chevron_right
flatMap (
array:
[*]
,cb:
) : Function
[*]
Builds a new collection by applying a function to all elements of this array and using the elements of the resulting collections.
Example
Arguments
array:
[*]
cb:
Function
Returns
[*]
Test Summary
#flatMap() should flatten the multi-dimensional array to a single-dimensional one | Pass |
#flatMap() should flatten to a single-dimensional array without odd numbers | Pass |
#flatMap() should throw a type error in case the first argument is not an array | Pass |
#flatMap() should throw a type error in case the second argument is not a function | Pass |