Array of objects seperate values that are same into a key for another array : I am trying to manipulate the json given below with javascript which has the list of products and categories for each product.

    [
  

    {
        "item_id": "1233131",
        "item_name": "cabbage",
        "item_price": "20$",
        "item_category": "vegetables"
      },
      {
        "item_id": "1233232",
        "item_name": "Tomato",
        "item_price": "15$",
        "item_category": "fruits"
      },
      {
        "item_id": "34323411",
        "item_name": "carrot",
        "item_price": "10$",
        "item_category": "vegetables"
      }
    ]

in which i want to seperate the categories and append all the products belong to that category 
Json i want to acheive:

    [
      {
        "title": "vegetables",
        "content": [
          {
            "item_id": "34323411",
            "item_name": "carrot",
            "item_price": "10$"
          },
          {
            "item_id": "1233131",
            "item_name": "cabbage",
            "item_price": "20$"
          }
        ]
      },
      {
        "title": "fruits",
        "content": [
          {
            "item_id": "1233232",
            "item_name": "Tomato",
            "item_price": "15$"
          }
        ]
      }
    ]

Thanks.!
