title: Javascript - Restructure array of objects
body: <p>I currently have an array of objects that looks like this:</p>
  
  <pre><code>[
      {
          "key":"CES0000000001",
          "25568.95655":"29923",
          "25568.96078":"31603"
      },
      {
          "key":"CES0000000001",
          "25568.96501":"34480",
          "25568.96924":"38347"
      }
  ]
  </code></pre>
  
  <p>I'm trying to figure out the best way to restructure this data to look like this:</p>
  
  <pre><code>[
      {
          "key":"CES0000000002",
          "values": [ [ 25568.95655 , 29923 ] , [ 25568.96078 , 31603 ] ]
      },
  
      {
          "key":"CES0000000002",
          "values": [ [ 25568.96501 , 34480 ] , [ 25568.96924 , 38347 ] ]
      }
  ]
  </code></pre>
  
  <p>Can anyone provide some advice for this and any good resources for restructuring javascript objects?  I'm getting more into visualization using d3.js and data formatting is key. </p>