Skip to content

Conversation

madsrasmussen
Copy link
Contributor

Browsers now ship an Object.groupBy method that does the same job as the one we have used from lodash. I have changed our code to use the native version instead and removed the export of the groupBy function from lodash.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/groupBy

@bjarnef
Copy link
Contributor

bjarnef commented Nov 7, 2023

@madsrasmussen I haven't had a deeper look at native groupBy yet, but besides Object.groupBy() it seems there are Map.groupBy() which accepts any data type as a key: https://dmitripavlutin.com/javascript-array-group/

image

@nielslyngsoe nielslyngsoe merged commit 2f33e9b into main Nov 7, 2023
@nielslyngsoe nielslyngsoe deleted the feature-use-native-groupBy branch November 7, 2023 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants