group-by
v1.0.0arrow_drop_downv1.0.0
v0.0.1
STATUS
Passing
DOWNLOADS
82
VISIBILITY
Public
PUBLISHED
7 years ago
SIZE
604 B
Creates an object composed of keys generated from the results of running
each element of `collection` thru `iteratee`.
1 contributor
Like
Install group-by as a package?
Copied
npm i @bit/ach5910.mefrontend.object.group-by
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
groupBy (
collection:
(Array | Object)
,iteratee:
) : Function
Object
Creates an object composed of keys generated from the results of running
each element of collection
thru iteratee
. The order of grouped values
is determined by the order they occur in collection
. The corresponding
value of each key is an array of elements responsible for generating the
key. The iteratee is invoked with one argument: (value).
Example
Arguments
collection:
(Array | Object)
The collection to iterate over.
iteratee:
Function
The iteratee to transform keys.
Returns
Object
Returns the composed aggregate object.
Test Summary
group-by the groupBy function should exist | Pass |
group-by should group by the floored value (4, 6) | Pass |