title: Javascript json data grouping
body: <p>Sorry if this has been asked before, but I couldn't find a good example of what I'm trying to accomplish. Maybe I'm just not searching for the right thing. Please correct me if there's an explanation of this somewhere. Anyway...</p>
  
  <p>I have JSON data structured like so...</p>
  
  <pre><code>{"Result":[
      {"Level":"ML","TeamName":"Team 1","League":"League 1"},
      {"Level":"ML","TeamName":"Team 2","League":"League 2"},
      {"Level":"ML","TeamName":"Team 3","League":"League 3"},
      {"Level":"3A","TeamName":"Team 4","League":"League 1"},
      {"Level":"3A","TeamName":"Team 5","League":"League 2"},
      {"Level":"3A","TeamName":"Team 6","League":"League 3"},
      {"Level":"2A","TeamName":"Team 7","League":"League 1"},
      {"Level":"2A","TeamName":"Team 8","League":"League 2"},
      {"Level":"2A","TeamName":"Team 9","League":"League 3"},
  ]}
  </code></pre>
  
  <p>I would like to group, or restructure it like so...</p>
  
  <pre><code>{"Result":[
      {"ML":[
          {"TeamName":"Team 1","League":"League 1"},
          {"TeamName":"Team 2","League":"League 2"},
          {"TeamName":"Team 3","League":"League 3"}
      ]},
      {"3A":[
          {"TeamName":"Team 4","League":"League 1"},
          {"TeamName":"Team 5","League":"League 2"},
          {"TeamName":"Team 6","League":"League 3"}
      ]},
      {"2A":[
          {"TeamName":"Team 7","League":"League 1"},
          {"TeamName":"Team 8","League":"League 2"},
          {"TeamName":"Team 9","League":"League 3"}
      ]}
  ]}
  </code></pre>
  
  <p>How would I accomplish this with Javascript/jQuery? Unfortunately I can't edit what the server is sending me.</p>