Skip to content
Advertisement

How do I transform the results of a Lodash groupBy in a _.chain

I have the following array:

JavaScript

After running it through .groupBy in a _.chain, I get the following:

JavaScript

How can I then transform it to the following?

JavaScript

I suspect that .transform is correct, just can’t figure out how to make it work.

Advertisement

Answer

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement