1 contributor
Like
Install group-with as a package?
Copied
npm i @bit/justin-capalbo.ramda.group-with
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
groupWith (
fn:
Function
,list:
) : Array
List
Takes a list and returns a list of lists where each sublist’s elements are all satisfied pairwise comparison according to the provided function. Only adjacent elements are passed to the comparison function.
Example
Arguments
fn:
Function
Function for determining whether two given (adjacent) elements should be in the same group
list:
Array
The array to group. Also accepts a string, which will be treated as a list of characters.
Returns
List
A list that contains sublists of elements, whose concatenations are equal to the original list.