Zmiana struktury JSON

OK, chłopaki potrzebują pomocy. Nadal uczę się Javascript i jego interakcji JSON. Mam taki JSON

[{
  "categories":"Food",
  "subcategories":"Shares",
  "pid":"111",
  "title":"Smoked Salmon Dip",
  "description":"Rich and savory salmon dip, whipped with fresh dill accompanied with     croustades"
   },
   {
  "categories":"Food",
  "subcategories":"Shares",
  "pid":"112",
  "title":"Sweet Goat Cheese Flatbread",
  "description":"Delicate grilled Naan flatbread coated with delish tomato jam and topped with melted goat cheese, roasted garlic, fennel, onion, pear, shiitake mushroom and arugula."
 },
 {
  "categories":"Food",
  "subcategories":"Snacks",
  "pid":"100",
  "title":"Beer Chili",
  "description":"Hot & satisfying short rib chili with black beans, smoked jalapenos, and fresh corn. Topped with aged cheddar cheese and sour cream."
 }];

Ale potrzebuję JSON, który wygląda tak

{
 "menu":{
  "categories":[
     {
                "name":"Food",
                "subcategories":[
                    {
                    "name":"Shares",
                    "items":[
                        {
                        "pid":"111",
                        "title":"Smoked Salmon Dip",
                        "description":"Rich and savory salmon dip, whipped with fresh dill accompanied with croustades"
                        },
                        {
                        "pid":"112",
                        "title":"Sweet Goat Cheese Flatbread",
                        "description":"Delicate grilled Naan flatbread coated with delish tomato jam and topped with melted goat cheese, roasted garlic, fennel, onion, pear, shiitake mushroom and arugula."
                        }
                        ]
                    },
                    {
                    "name":"Snacks",
                    "items":[
                        {                       
                        "pid":"100",
                        "title":"Beer Chili",
                        "description":"Hot & satisfying short rib chili with black beans, smoked jalapenos, and fresh corn. Topped with aged cheddar cheese and sour cream."
                        }
                        ]
                    }
                    ]
        }]
        }
     }

Wiem, że jest to trochę brzydkie, ale mam problem z ustaleniem, jak zbudować nowy JSON, ponieważ przechodzę przez mój obecny.

Jakakolwiek pomoc w uzyskaniu mnie byłaby niesamowita

questionAnswers(2)

yourAnswerToTheQuestion