Snippet format update
To match the starter (for the migration)
This commit is contained in:
@ -1,4 +1,7 @@
|
||||
### groupBy
|
||||
---
|
||||
title: groupBy
|
||||
tags: array,object,intermediate
|
||||
---
|
||||
|
||||
Groups the elements of an array based on the given function.
|
||||
|
||||
@ -16,4 +19,4 @@ const groupBy = (arr, fn) =>
|
||||
```js
|
||||
groupBy([6.1, 4.2, 6.3], Math.floor); // {4: [4.2], 6: [6.1, 6.3]}
|
||||
groupBy(['one', 'two', 'three'], 'length'); // {3: ['one', 'two'], 5: ['three']}
|
||||
```
|
||||
```
|
||||
Reference in New Issue
Block a user