Ed

Grouping data by a property is one of the most useful patterns. Let's build our own groupBy function!

Your Task:

  • Create a groupBy(array, key) function
  • It should return an object where keys are unique values of key
  • Each key maps to an array of matching items
  • Test it by grouping products by category
TypeScript Solution
Loading...

Submit your code to see test results