0

I have such array of objects:

[{id: 1, name: 'Apple', category: 'Fruit'}
{id: 2, name: 'Melon', category: 'Fruit'}
{id: 3, name: 'iPhone', category: 'Phone'}
{id: 4, name: 'Samsung Galaxy Note 8', category: 'Phone'}
{id: 5, name: 'Playstation 5', category: 'Entertainment'}]

and what I wanted to achieve is to combine product names by category and show them like:

Fruit
  Apple
  Melon
Phone
  iPhone
  Samsung Galaxy Note 8
Entertainment
  Playstation 5
qweeee
  • 63
  • 1
  • 2
  • 8
  • @ponury-kostek, unfortunately no since I need to show category as title of section in html – qweeee Nov 08 '21 at 19:33
  • 1
    The linked question outlines the strategy to perform the grouping: how you want to output that in your mark-up is entirely up to you. – Terry Nov 08 '21 at 19:38

0 Answers0